From 7c7398c04653877da09c7b0f80ee84b02e02aad0 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Fri, 13 Dec 2024 16:37:08 +0100 Subject: [PATCH] fix(cli): let sync throw in check (#12726) --- .changeset/twenty-keys-divide.md | 5 +++++ packages/astro/src/cli/check/index.ts | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .changeset/twenty-keys-divide.md diff --git a/.changeset/twenty-keys-divide.md b/.changeset/twenty-keys-divide.md new file mode 100644 index 0000000000..9e84058674 --- /dev/null +++ b/.changeset/twenty-keys-divide.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a case where failing content entries in `astro check` would not be surfaced diff --git a/packages/astro/src/cli/check/index.ts b/packages/astro/src/cli/check/index.ts index c93e3b2f4c..b7e03aa30e 100644 --- a/packages/astro/src/cli/check/index.ts +++ b/packages/astro/src/cli/check/index.ts @@ -31,11 +31,7 @@ export async function check(flags: Flags) { // NOTE: In the future, `@astrojs/check` can expose a `before lint` hook so that this works during `astro check --watch` too. // For now, we run this once as usually `astro check --watch` is ran alongside `astro dev` which also calls `astro sync`. const { default: sync } = await import('../../core/sync/index.js'); - try { - await sync(flagsToAstroInlineConfig(flags)); - } catch (_) { - return process.exit(1); - } + await sync(flagsToAstroInlineConfig(flags)); } const { check: checker, parseArgsAsCheckConfig } = checkPackage;