FontCustom / fontcustom

Generate custom icon webfonts from the comfort of the command line.
3.28k stars 423 forks source link

Running `fontcustom compile .` leads to cryptic errors about trying to File.read a direcory. #195

Open dantman opened 10 years ago

dantman commented 10 years ago

I'm trying out FontCustom now and I've been getting errors like: /Library/Ruby/Gems/2.0.0/gems/fontcustom-1.3.3/lib/fontcustom/base.rb:44:in `read': Is a directory - ./templates (Errno::EISDIR)

I've examined the code and think I figured out why this happens:

I have found proper ways of running fontcustom now (-c and omitting the path), but I think there are still a few things that should be fixed:

jaydenseric commented 10 years ago

I have been having nightmares with this cryptic error message.

This is my folder structure:

font-custom-project-filestructure

This is the config:

font_name: icons
no_hash: true
input:
  vectors: svg
  templates: .
output:
  fonts: .
  _icons.scss: ../../styles
templates: [_icons.scss]

Running from the project root:

$ fontcustom watch fonts/icons

I get the error:

/Users/chejss/.rvm/gems/ruby-2.1.1/gems/fontcustom-1.3.3/lib/fontcustom/base.rb:43:in `read': Is a directory @ io_fread - ./svg (Errno::EISDIR) 
jaydenseric commented 10 years ago

Anyone know what I have to do to get everything to work in the meantime? I am attempting to use Font Custom on two real-world projects with deadlines...

dantman commented 10 years ago

@jaydenseric Try cd'ing into fonts/icons and running fontcustom watch without any arguments.

jaydenseric commented 10 years ago

@dantman I have tried that, to exactly the same effect :(

dantman commented 10 years ago

@jaydenseric Try deleting the .fontcustom-manifest.json and regenerating everything. The manifest goes and saves/overrides parts of the config, even if it's probably a bad idea.

jaydenseric commented 10 years ago

@dantman I tried that, no effect also.

What did work was restructuring everything.

In the end:

font-custom-project-filestructure-working

With:

font_name: icons
no_hash: true
output:
  fonts: ../
  _icons.scss: ../../../styles
templates: [_icons.scss]

Running from the project root:

$ cd fonts/icons/fontcustom
$ fontcustom watch 

Note that running $ fontcustom watch fonts/icons/fontcustom from the project root will not pick up the config file and will set up a standard fontcustom folder in the root.

ShaggyDude commented 10 years ago

can you create a repo with all the default templates set up so that someone can pull it down and tweak the templates? Very cool project with a very frustrating setup..

jaydenseric commented 10 years ago

@ShaggyDude Might do that this weekend. It is already on Github as part of my Barebones repo but it does make sense to maintain the Font Custom Sass setup independently.