diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2017-05-25 06:36:16 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-05-26 04:55:30 +0300 |
commit | 30d79062869c49c0d6cf6adf57cfbe79c2c050b9 (patch) | |
tree | 324f7b1d6c1f51d3a9c0622da293285890b5f00a /lib | |
parent | 5529a238153e570b7119f3f73b9b86c25b376167 (diff) |
error-handler: force an exit instead of waiting for tasks
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/error-handler.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/utils/error-handler.js b/lib/utils/error-handler.js index 8365f39d9..5374d1fee 100644 --- a/lib/utils/error-handler.js +++ b/lib/utils/error-handler.js @@ -130,10 +130,12 @@ function exit (code, noLog) { itWorked = !code - // just emit a fake exit event. - // if we're really exiting, then let it exit on its own, so that - // in-process stuff can finish or clean up first. - if (!doExit) process.emit('exit', code) + // Exit directly -- nothing in the CLI should still be running in the + // background at this point, and this makes sure anything left dangling + // for whatever reason gets thrown away, instead of leaving the CLI open + // + // Commands that expect long-running actions should just delay `cb()` + process.exit(code) } } |