0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

fallback to latest

This commit is contained in:
apatel369 2024-12-08 14:24:17 -06:00
parent 06aede7c7c
commit 3f28643066

View file

@ -34,7 +34,9 @@ export interface Context {
}
export async function getContext(argv: string[]): Promise<Context> {
const packageTag = argv.find((argItem) => /^(astro|create-astro)@/.exec(argItem))?.split('@')[1];
const packageSpecifier = argv.find((argItem) => /^(astro|create-astro)@/.exec(argItem))?.split('@')[1];
// Fallback to 'latest' if it's a version number
const packageTag = packageSpecifier && /^v?\d[^a-zA-Z]*$/.test(packageSpecifier) ? 'latest' : packageSpecifier;
const flags = arg(
{