Fix the $native.exec callback in ChildProcess.exec

It's stderr, not stdin. Also we have to look at exitStatus, not error to see if the process failed. None of this is tested, which is bad.
This commit is contained in:
Nathan Sobo
2012-07-11 18:48:49 -06:00
parent 92f4519db2
commit db6692b2f6

View File

@@ -13,13 +13,13 @@ class ChildProccess
options.stdout = @bufferLines(options.stdout) if options.stdout
options.stderr = @bufferLines(options.stderr) if options.stderr
$native.exec command, options, (exitStatus, stdout, stdin) ->
if error != 0
$native.exec command, options, (exitStatus, stdout, stderr) ->
if exitStatus != 0
error = new Error("Exec failed (#{exitStatus}) command '#{command}'")
error.exitStatus = exitStatus
deferred.reject(error)
else
deferred.resolve(stdout, stdin)
deferred.resolve(stdout, stderr)
deferred