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:
parent
c8a654a3ea
commit
8faa197bca
|
@ -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})
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue