mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-06 06:28:33 +03:00
Use close instead of exit
stdio might still be open when exit is called (http://nodejs.org/api/child_process.html#child_process_event_exit). With close you are guaranteed that there will be no more output.
This commit is contained in:
parent
ca6da5f9c1
commit
d3c6bd2f98
@ -39,7 +39,7 @@ module.exports = (grunt) ->
|
||||
proc = childProcess.spawn(options.cmd, options.args, options.opts)
|
||||
proc.stdout.on 'data', (data) -> stdout.push(data.toString())
|
||||
proc.stderr.on 'data', (data) -> stderr.push(data.toString())
|
||||
proc.on 'exit', (exitCode, signal) ->
|
||||
proc.on 'close', (exitCode, signal) ->
|
||||
error = new Error(signal) if exitCode != 0
|
||||
results = {stderr: stderr.join(''), stdout: stdout.join(''), code: exitCode}
|
||||
grunt.log.error results.stderr if exitCode != 0
|
||||
|
Loading…
Reference in New Issue
Block a user