Skip to content

Commit

Permalink
fix(cli): allow no-confirm no-dry-run migrations (#7031)
Browse files Browse the repository at this point in the history
Co-authored-by:
Paul Ngei <[email protected]>
  • Loading branch information
ricokahler committed Jun 27, 2024
1 parent 4af12eb commit b06d143
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@ const runMigrationCommand: CliCommandDefinition<CreateFlags> = {
`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<boolean>({
if (flags.confirm) {
const response = await prompt.single<boolean>({
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()
Expand Down

0 comments on commit b06d143

Please sign in to comment.