0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-27 22:19:04 -05:00

fix tag name

This commit is contained in:
apatel369 2024-11-26 21:09:16 -06:00
parent 4a491f23d4
commit 421f7680be
2 changed files with 5 additions and 4 deletions

View file

@ -75,7 +75,8 @@ export async function getContext(argv: string[]): Promise<Context> {
'--add': add,
} = flags;
let projectName = cwd;
const tag = ref === 'next' ? 'beta' : ref;
if (no) {
yes = false;
if (install == undefined) install = false;
@ -93,7 +94,7 @@ export async function getContext(argv: string[]): Promise<Context> {
prompt,
packageManager,
username: getName(),
version: getVersion(packageManager, 'astro', process.env.ASTRO_VERSION, ref),
version: getVersion(packageManager, 'astro', process.env.ASTRO_VERSION, tag),
skipHouston,
fancy,
add,

View file

@ -60,10 +60,10 @@ export const getName = () =>
});
});
export const getVersion = (packageManager: string, packageName: string, fallback = '', ref = 'latest') =>
export const getVersion = (packageManager: string, packageName: string, fallback = '', tag = 'latest') =>
new Promise<string>(async (resolve) => {
let registry = await getRegistry(packageManager);
const { version } = await fetch(`${registry}/${packageName}/${ref}`, {
const { version } = await fetch(`${registry}/${packageName}/${tag}`, {
redirect: 'follow',
})
.then((res) => res.json())