sterpe / coffee-fmt

gofmt for coffee
MIT License
9 stars 4 forks source link

does not work at all #10

Closed dholth closed 9 years ago

dholth commented 9 years ago

I'm trying to run coffee-fmt with 'npm install -g coffee-fmt'. Unfortunately the coffee-fmt script does not begin with a shebang interpreter e.g. #!/usr/bin/node . If I add one, I get errors. It appears that the program does not work at all. Instead, it would be preferable if instead of crashing the coffee-fmt program formatted coffeescript.

node opt/node/bin/coffee-fmt

fs.js:432
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
TypeError: path must be a string
    at Object.fs.openSync (fs.js:432:18)
    at Object.fs.readFileSync (fs.js:286:15)
    at fmt (opt/node/lib/node_modules/coffee-fmt/lib/cmd.js:41:13)
    at Object.<anonymous> (opt/node/lib/node_modules/coffee-fmt/lib/cmd.js:48:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
sterpe commented 9 years ago

Apparently, when rewrote in cs the shebang line gets commented out in compile to JS.

Fixed here 698f3d94fd56588ab7b95079cae516bc9fd53c18

Please update to 0.7.0 then follow the documentation in read me.

coffee-fmt -i file.coffee