Fixed spawn() resolving too early

When the "exit" event is triggered, child process stdio streams might
still be open and not flushed yet. This can lead to a loss of
stdout/stderr data.
This commit is contained in:
Leonard Hecker 2016-06-22 14:16:47 +02:00
parent c8a654a3ea
commit 8faa197bca
1 changed files with 1 additions and 1 deletions

View File

@ -313,7 +313,7 @@ module.exports = class Beautifier
# when the spawn child process exits,
# check if there were any errors and
# close the writeable stream
cmd.on('exit', (returnCode) =>
cmd.on('close', (returnCode) =>
@debug('spawn done', returnCode, stderr, stdout)
resolve({returnCode, stdout, stderr})
)