Skip to content

Commit b5b39e4

Browse files
authored
fix: exit with non-zero code for Zod errors (#14106)
1 parent c7a7dd5 commit b5b39e4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/few-rules-lose.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Exits with non-zero exit code when config has an error

packages/astro/src/cli/throw-and-exit.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import { eventError, telemetry } from '../events/index.js';
88
/** Display error and exit */
99
export async function throwAndExit(cmd: string, err: unknown) {
1010
// Suppress ZodErrors from AstroConfig as the pre-logged error is sufficient
11-
if (isAstroConfigZodError(err)) return;
11+
if (isAstroConfigZodError(err)) {
12+
process.exit(1);
13+
}
1214

1315
let telemetryPromise: Promise<any>;
1416
let errorMessage: string;

0 commit comments

Comments
 (0)