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:
parent
44af543c0d
commit
19b3ac0036
2 changed files with 12 additions and 1 deletions
5
.changeset/little-rules-relate.md
Normal file
5
.changeset/little-rules-relate.md
Normal 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
|
|
@ -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);
|
||||
if (!ok) {
|
||||
|
|
Loading…
Reference in a new issue