Skip to content

Commit

Permalink
Exit process on prompts abort. Fixes #627.
Browse files Browse the repository at this point in the history
  • Loading branch information
raineorshine committed Mar 7, 2021
1 parent 0b7c426 commit 5e3029f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/versionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,12 @@ async function upgradePackageData(pkgData, oldDependencies, newDependencies, new
type: 'confirm',
name: 'value',
message: `Do you want to upgrade: ${dependency} ${oldDependencies[dependency]}${to}?`,
initial: true
initial: true,
onState: state => {
if (state.aborted) {
process.nextTick(() => process.exit(1))
}
}
})
if (!response.value) {
// continue loop to next dependency and skip updating newPkgData
Expand Down

0 comments on commit 5e3029f

Please sign in to comment.