Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
fix(exit): let process exit normally to finish writes
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Jun 10, 2017
1 parent d838a43 commit c50a398
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@ function main (argv) {
shell, process.env.SHELL, argv
)
if (fallback) {
console.log(fallback)
process.exit(0)
return console.log(fallback)
} else {
process.exit(1)
process.exitCode = 1
return
}
}

if (!argv.command || !argv.package) {
console.error('\nERROR: You must supply a command.\n')
console.error(Y`\nERROR: You must supply a command.\n`)
parseArgs.showHelp()
process.exit(1)
process.exitCode = 1
return
}

return localBinPath(process.cwd()).then(local => {
Expand All @@ -52,7 +53,7 @@ function main (argv) {
}
).catch(err => {
console.error(err.message)
process.exit(err.exitCode || 1)
process.exitCode = err.exitCode || 1
})
})
}
Expand Down

0 comments on commit c50a398

Please sign in to comment.