0
Fork 0
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:
Matthew Phillips 2024-01-23 10:50:34 -05:00 committed by Nate Moore
parent 603bc846aa
commit 2dc8331b59

View file

@ -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`
}
}