mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
Give a help message when no db command is provided
This commit is contained in:
parent
603bc846aa
commit
2dc8331b59
1 changed files with 21 additions and 2 deletions
|
@ -18,9 +18,28 @@ export async function cli({ flags, config }: { flags: Arguments; config: AstroCo
|
|||
return await verifyCommand({ config, flags });
|
||||
}
|
||||
default: {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Unknown command: ${command}`);
|
||||
if(command == null) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`No command provided.
|
||||
|
||||
${showHelp()}`);
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Unknown command: ${command}
|
||||
|
||||
${showHelp()}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function showHelp() {
|
||||
return `astro db <command>
|
||||
|
||||
Usage:
|
||||
|
||||
astro db sync Creates snapshot based on your schema
|
||||
astro db push Pushes migrations to Astro Studio
|
||||
astro db verify Verifies migrations have been pushed and errors if not`
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue