diff --git a/packages/create-astro/src/actions/context.ts b/packages/create-astro/src/actions/context.ts index 31a1bcfd13ed..5bed2670ea99 100644 --- a/packages/create-astro/src/actions/context.ts +++ b/packages/create-astro/src/actions/context.ts @@ -74,7 +74,8 @@ export async function getContext(argv: string[]): Promise { '--ref': ref, } = 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 { prompt, packageManager, username: getName(), - version: getVersion(packageManager, 'astro', process.env.ASTRO_VERSION, ref), + version: getVersion(packageManager, 'astro', process.env.ASTRO_VERSION, tag), skipHouston, fancy, dryRun, diff --git a/packages/create-astro/src/messages.ts b/packages/create-astro/src/messages.ts index 30bd4f231d41..51b9f2116fdf 100644 --- a/packages/create-astro/src/messages.ts +++ b/packages/create-astro/src/messages.ts @@ -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(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())