0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00
This commit is contained in:
apatel369 2024-12-08 14:26:54 -06:00
parent 3f28643066
commit 8a6bcbde23

View file

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