Skip to content

Commit

Permalink
Remove reliance on the _exit pseudo-config in error handler
Browse files Browse the repository at this point in the history
This flag no longer exists.  We just always exit now when we're done.
  • Loading branch information
isaacs committed Aug 24, 2020
1 parent b38f68a commit 9f200ab
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions lib/utils/error-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,17 @@ process.on('exit', code => {
wroteLogFile = false
}

const doExit = npm.config && npm.config.loaded && npm.config.get('_exit')
if (doExit) {
// actually exit.
if (exitCode === 0 && !itWorked) {
exitCode = 1
}
if (exitCode !== 0) process.exit(exitCode)
} else {
itWorked = false // ready for next exit
// actually exit.
if (exitCode === 0 && !itWorked) {
exitCode = 1
}
if (exitCode !== 0) process.exit(exitCode)
})

const exit = (code, noLog) => {
exitCode = exitCode || process.exitCode || code

const doExit = npm.config && npm.config.loaded ? npm.config.get('_exit') : true
log.verbose('exit', [code, doExit])
log.verbose('exit', code)
if (log.level === 'silent') noLog = true

const reallyExit = (er) => {
Expand Down

0 comments on commit 9f200ab

Please sign in to comment.