mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user