diff --git a/packages/core/strapi/bin/strapi.js b/packages/core/strapi/bin/strapi.js index 72dd9f9685..c07c6fe4d5 100755 --- a/packages/core/strapi/bin/strapi.js +++ b/packages/core/strapi/bin/strapi.js @@ -342,7 +342,8 @@ program } await confirmMessage( - 'The transfer will delete all data in the remote database and media files. Are you sure you want to proceed?' + 'The transfer will delete all data in the remote database and media files. Are you sure you want to proceed?', + { failMessage: 'Transfer process aborted' } )(thisCommand); } ) @@ -450,7 +451,8 @@ program .hook( 'preAction', confirmMessage( - 'The import will delete all data in your database and media files. Are you sure you want to proceed?' + 'The import will delete all data in your database and media files. Are you sure you want to proceed?', + { failMessage: 'Import process aborted' } ) ) .action(getLocalScript('transfer/import')); diff --git a/packages/core/strapi/lib/commands/utils/commander.js b/packages/core/strapi/lib/commands/utils/commander.js index c60f572b8f..e8b36d1526 100644 --- a/packages/core/strapi/lib/commands/utils/commander.js +++ b/packages/core/strapi/lib/commands/utils/commander.js @@ -97,7 +97,7 @@ const promptEncryptionKey = async (thisCommand) => { * @param {string} message The message to confirm with user * @param {object} options Additional options */ -const confirmMessage = (message) => { +const confirmMessage = (message, { failMessage } = {}) => { return async (command) => { // if we have a force option, assume yes const opts = command.opts(); @@ -116,7 +116,7 @@ const confirmMessage = (message) => { }, ]); if (!answers.confirm) { - exitWith(1); + exitWith(1, failMessage); } }; };