From ee5bb2fa5c68bd0c81d33a7d265dfa439d35c602 Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Wed, 8 Apr 2026 18:51:58 +0300 Subject: [PATCH] fix(cli): exit on git failure in annotation checker --- script/check-opencode-annotations.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/check-opencode-annotations.ts b/script/check-opencode-annotations.ts index 314b399d46..48370c990f 100644 --- a/script/check-opencode-annotations.ts +++ b/script/check-opencode-annotations.ts @@ -35,6 +35,11 @@ const base = baseIdx !== -1 ? args[baseIdx + 1] : "origin/main" function run(cmd: string, args: string[]) { const result = spawnSync(cmd, args, { cwd: ROOT, encoding: "utf8" }) + if (result.status !== 0) { + const msg = result.stderr?.trim() || result.stdout?.trim() || "unknown error" + console.error(`Command failed: ${cmd} ${args.join(" ")}\n${msg}`) + process.exit(1) + } return result.stdout?.trim() ?? "" }