mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
format
This commit is contained in:
parent
3f28643066
commit
8a6bcbde23
1 changed files with 5 additions and 2 deletions
|
@ -34,9 +34,12 @@ export interface 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
|
||||
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(
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue