PaulBernier / castl

JavaScript to Lua compiler with runtime library.
GNU Lesser General Public License v3.0
372 stars 33 forks source link

no such file or directory: code.js #12

Closed Daniel-Hug closed 7 years ago

Daniel-Hug commented 7 years ago

I have a JS file named contiguous.js that I want to convert to Lua. Running castl -o contiguous.js gives this error:

Daniel@LAPTOP-J4LVCVKU MINGW64 ~/Desktop/repos/mine/contiguous-2d
$ castl -o contiguous.js
C:\Users\Daniel\AppData\Roaming\npm\node_modules\castl\bin\castl.js:170
        throw new SyntaxError("Couldn't transpile JS code: " + e);
        ^

SyntaxError: Couldn't transpile JS code: Error: ENOENT: no such file or directory, open 'C:\Users\Daniel\Desktop\repos\mine\contiguous-2d\code.js'
    at C:\Users\Daniel\AppData\Roaming\npm\node_modules\castl\bin\castl.js:170:15
    at Object.<anonymous> (C:\Users\Daniel\AppData\Roaming\npm\node_modules\castl\bin\castl.js:292:2)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)

Why is it looking for code.js when I ran it on contiguous.js? What am I missing? I am on Windows 10.

PaulBernier commented 7 years ago

Hi Daniel, You put the name of your file after -o option, which makes it the name of the output file! The correct syntax is: castl contiguous.js -o

Daniel-Hug commented 7 years ago

Thanks Paul!