diff --git a/packages/sanity/src/_internal/cli/commands/migration/runMigrationCommand.ts b/packages/sanity/src/_internal/cli/commands/migration/runMigrationCommand.ts index 90944cd50b3..ab0a33ca8c3 100644 --- a/packages/sanity/src/_internal/cli/commands/migration/runMigrationCommand.ts +++ b/packages/sanity/src/_internal/cli/commands/migration/runMigrationCommand.ts @@ -186,18 +186,18 @@ const runMigrationCommand: CliCommandDefinition = { `To adjust them, launch the management interface with ${chalk.cyan('sanity manage')}, navigate to the API settings, and toggle the webhooks before and after the migration as needed.\n`, ) - const response = - flags.confirm && - (await prompt.single({ + if (flags.confirm) { + const response = await prompt.single({ message: `This migration will run on the ${chalk.yellow( chalk.bold(apiConfig.dataset), )} dataset in ${chalk.yellow(chalk.bold(apiConfig.projectId))} project. Are you sure?`, type: 'confirm', - })) + }) - if (response === false) { - debug('User aborted migration') - return + if (!response) { + debug('User aborted migration') + return + } } const spinner = output.spinner(`Running migration "${id}"`).start()