bevry / cson

CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.
Other
1.34k stars 56 forks source link

unknown conversion error #133

Closed aminya closed 12 months ago

aminya commented 4 years ago

I have installed cson on Windows globally using npm install --global cson, but I get an unknown conversion error when I try to run the commands from Powershell:

> cson2json in.cson > out.json
Unknown conversion

> cat in.cson | cson2json > out.json
Unknown conversion
balupton commented 4 years ago

Can you debug on your side? I don't have windows so I cannot test.

To debug follow the contributing.md instructions and run npm link to expose the bins globally.

mattacosta commented 4 years ago

It looks like the command name isn't being sent along in process.argv:

[
  'C:\\Program Files\\nodejs\\node.exe',
  'C:\\Users\\redacted\\Projects\\redacted\\node_modules\\cson\\bin.js',
  'path/to/file.cson'
]

I tried forcing the issue by using npx cson2json cson2json path/to/file.cson, but then process.argv.length equals 4 and boots me to the if-block that prints usage information.

balupton commented 4 years ago

I think I'm going to go back to using two seperate cli files, instead of the merging of one.

sigod commented 3 years ago

I'm experiencing the same issue. So far I have to manually edit cson/edition-esnext/bin.js to use the parser.

aminya commented 3 years ago

This was fixed in #136, but it was never merged. You can use that fork instead.