Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 21, 2023
1 parent f4eebca commit df63716
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ ttyStream.isTTY = true
*/
let exitCode

let forceExit = false

process.on('exit', onexit)

// Handle uncaught errors, such as from unexpected async behaviour.
Expand Down Expand Up @@ -122,6 +124,10 @@ export function args(options) {
subscribe(context)
}
}

if (forceExit) {
onexit()
}
}

// Clean the watcher.
Expand Down Expand Up @@ -175,7 +181,9 @@ export function args(options) {
if (output === true) {
state.engine.output = output
state.args.watch = false
forceExit = true
engine(state.engine, done)
} else {
onexit()
}
}
Expand Down

0 comments on commit df63716

Please sign in to comment.