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:
parent
06aede7c7c
commit
3f28643066
1 changed files with 3 additions and 1 deletions
|
@ -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(
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue