0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

fix(upgrade): verify astro installation before upgrade to prevent false success (#12576)

This commit is contained in:
Arpan Patel 2024-12-04 01:17:07 -06:00 committed by GitHub
parent 44af543c0d
commit 19b3ac0036
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/upgrade': patch
---
Fixes an issue where running `upgrade` in a directory without `astro` installed shows a false success message

View file

@ -24,7 +24,13 @@ export async function verify(
} }
} }
await verifyAstroProject(ctx); const isAstroProject = await verifyAstroProject(ctx);
if (!isAstroProject) {
bannerAbort();
newline();
error('error', `Astro installation not found in the current directory.`);
ctx.exit(1);
}
const ok = await verifyVersions(ctx, registry); const ok = await verifyVersions(ctx, registry);
if (!ok) { if (!ok) {