Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI haml-coffee not working when using --input with a folder on Windows #70

Closed
akhanubis opened this issue Jun 16, 2013 · 1 comment
Closed

Comments

@akhanubis
Copy link

Folder structure:

C:\testing>dir /s
 Directory of C:\testing

06/16/2013  06:58 PM                 0 chau.hamlc
06/16/2013  06:58 PM                 0 hola.hamlc
06/16/2013  07:10 PM    <DIR>          subfolder

 Directory of C:\testing\subfolder

06/16/2013  07:09 PM                 0 im_in_subfolder.hamlc

Failing example:

C:\testing>haml-coffee --input .
  [Haml Coffee] Compiling directory .
  [Haml Coffee] Compiling file . to chau.jst

C:\testing>

As the above example shows, It only compiles one file when having more than one.

It's a known issue of node-findit that it can't traverse folders on Windows (https://github.com/substack/node-findit/issues/5#ref-issue-14717884). Fortunately, there is an API compatible alternative to findit called walkdir (https://github.com/soldair/node-walkdir).

Installing walkdir and changing line 4 in command.coffee to findit = require 'walkdir' seems to fix this:

C:\testing>haml-coffee --input .
  [Haml Coffee] Compiling directory .
  [Haml Coffee] Compiling file . to C:\testing\chau.jst
  [Haml Coffee] Compiling file . to C:\testing\hola.jst
  [Haml Coffee] Compiling file . to C:\testing\subfolder\im_in_subfolder.jst

Thanks in advance

@netzpirat
Copy link
Owner

Thanks a lot! I wish all issues were like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants