Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
apatel369 committed Dec 8, 2024
1 parent 3f28643 commit 8a6bcbd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/create-astro/src/actions/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down

0 comments on commit 8a6bcbd

Please sign in to comment.