@avelonjs/cli 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands.ts +11 -3
- package/src/driver-scaffold.ts +1 -0
package/package.json
CHANGED
package/src/commands.ts
CHANGED
|
@@ -293,7 +293,10 @@ export async function runCommand(
|
|
|
293
293
|
io,
|
|
294
294
|
`Avelon reeve · ${bits.app} · ${bits.database} · ${bits.adapter} · ${bits.environment}`,
|
|
295
295
|
)
|
|
296
|
-
writeln(
|
|
296
|
+
writeln(
|
|
297
|
+
io,
|
|
298
|
+
'Packages: @avelonjs/cli @avelonjs/next @avelonjs/bailiff @avelonjs/assay @avelonjs/core',
|
|
299
|
+
)
|
|
297
300
|
return 0
|
|
298
301
|
}
|
|
299
302
|
case 'errand:work': {
|
|
@@ -340,10 +343,15 @@ export async function runCommand(
|
|
|
340
343
|
}
|
|
341
344
|
}
|
|
342
345
|
|
|
346
|
+
function confirmation(argv: readonly string[], io: ReeveIO): string | undefined {
|
|
347
|
+
const prefix = '--confirm='
|
|
348
|
+
return argv.find((arg) => arg.startsWith(prefix))?.slice(prefix.length) ?? io.confirm
|
|
349
|
+
}
|
|
350
|
+
|
|
343
351
|
async function runMigrate(command: string, argv: readonly string[], io: ReeveIO): Promise<number> {
|
|
344
352
|
const env = headerBits(io).environment
|
|
345
|
-
if (command === 'migrate:fresh' && env !== 'local' && io
|
|
346
|
-
writeln(io, `Refusing migrate:fresh on ${env}. Pass
|
|
353
|
+
if (command === 'migrate:fresh' && env !== 'local' && confirmation(argv, io) !== env) {
|
|
354
|
+
writeln(io, `Refusing migrate:fresh on ${env}. Pass --confirm=${env} to proceed.`)
|
|
347
355
|
return 1
|
|
348
356
|
}
|
|
349
357
|
try {
|
package/src/driver-scaffold.ts
CHANGED