jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.97k stars 190 forks source link

jake.createExec throws an error when there's a space in the directory? #302

Closed iam3yal closed 8 years ago

iam3yal commented 8 years ago

Here is the error I'm getting.

jake aborted.
Error: Uncaught, unspecified "error" event.
    at Error (native)
    at emit (events.js:87:13)
    at ChildProcess.<anonymous> (C:\users\eyal.lionking\appdata\roaming\npm\node_modules\jake\lib\utils\index.js:227:20)
    at ChildProcess.emit (events.js:110:17)
    at Process.ChildProcess._handle.onexit (child_process.js:1074:12)

Here is what I've tried to execute.

jake.createExec("ls \"h:/test dir\"").run()

I've tried to do the same directly with nodejs and it seems to work just fine.

require("child_process").exec("ls \"h:/test dir\"",  function (error, stdout, stderr) {
        console.log('stdout: ' + stdout);
        console.log('stderr: ' + stderr);
        if (error !== null) {
        console.log('exec error: ' + error);
        }
    });
iam3yal commented 8 years ago

I've checked the code and I saw that I can pass {windowsVerbatimArguments: true} so once I did, it worked but I'm not 100% sure what it does and I didn't find any documentation about it, clarification would be much appreciated.