From 5e3029fb54acb0d3af140df1536f1746245becdf Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Sun, 7 Mar 2021 10:58:39 -0700 Subject: [PATCH] Exit process on prompts abort. Fixes #627. --- lib/versionmanager.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/versionmanager.js b/lib/versionmanager.js index 5edde5c9..fdeaec9d 100644 --- a/lib/versionmanager.js +++ b/lib/versionmanager.js @@ -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