diff --git a/.changeset/little-rules-relate.md b/.changeset/little-rules-relate.md new file mode 100644 index 0000000000..b0b01a87ba --- /dev/null +++ b/.changeset/little-rules-relate.md @@ -0,0 +1,5 @@ +--- +'@astrojs/upgrade': patch +--- + +Fixes an issue where running `upgrade` in a directory without `astro` installed shows a false success message diff --git a/packages/upgrade/src/actions/verify.ts b/packages/upgrade/src/actions/verify.ts index 193b0477a1..384df5134a 100644 --- a/packages/upgrade/src/actions/verify.ts +++ b/packages/upgrade/src/actions/verify.ts @@ -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) {