From db6692b2f69de37413803dea949c8e4678997ee7 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 11 Jul 2012 18:48:49 -0600 Subject: [PATCH] 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. --- src/stdlib/child-process.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stdlib/child-process.coffee b/src/stdlib/child-process.coffee index 164fd1c13..e8885a7a2 100644 --- a/src/stdlib/child-process.coffee +++ b/src/stdlib/child-process.coffee @@ -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