mirror of
https://github.com/withastro/astro.git
synced 2025-01-13 22:11:20 -05:00
fix bug in prompt logic
This commit is contained in:
parent
54a981cd5c
commit
1c69feecf0
1 changed files with 15 additions and 14 deletions
|
@ -97,20 +97,21 @@ async function pushSchema({
|
|||
const confirmations = missingMigrationContents.reduce((acc, curr) => {
|
||||
return [...acc, ...(curr.confirm || [])];
|
||||
}, [] as string[]);
|
||||
|
||||
const response = await prompts([
|
||||
...confirmations.map((message, index) => ({
|
||||
type: 'confirm' as const,
|
||||
name: String(index),
|
||||
message: red('Warning: ') + message + '\nContinue?',
|
||||
initial: true,
|
||||
})),
|
||||
]);
|
||||
if (
|
||||
Object.values(response).length === 0 ||
|
||||
Object.values(response).some((value) => value === false)
|
||||
) {
|
||||
process.exit(1);
|
||||
if (confirmations.length > 0) {
|
||||
const response = await prompts([
|
||||
...confirmations.map((message, index) => ({
|
||||
type: 'confirm' as const,
|
||||
name: String(index),
|
||||
message: red('Warning: ') + message + '\nContinue?',
|
||||
initial: true,
|
||||
})),
|
||||
]);
|
||||
if (
|
||||
Object.values(response).length === 0 ||
|
||||
Object.values(response).some((value) => value === false)
|
||||
) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// combine all missing migrations into a single batch
|
||||
|
|
Loading…
Add table
Reference in a new issue