Skip to content

Commit de01a37

Browse files
t3dotggclaude
andcommitted
fix(scripts): check:changed keeps a failing step's output when piped
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3588360 commit de01a37

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎scripts/check-changed.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ const ciOnly = Object.entries({
210210
if (ciOnly.length > 0) summary.push(` CI also runs: ${ciOnly.join(", ")}`);
211211
if (!runKnip) summary.push(" knip skipped: no code or manifest changed");
212212
console.log(`\n${summary.join("\n")}`);
213-
if (results.some((result) => !result.ok)) process.exit(1);
214-
NodeFS.mkdirSync(NodePath.dirname(cachePath), { recursive: true });
215-
NodeFS.writeFileSync(cachePath, JSON.stringify({ key, summary }));
213+
// exitCode, not exit(): piped stdout is asynchronous on macOS, and exit()
214+
// would cut off a failing step's output.
215+
if (results.some((result) => !result.ok)) {
216+
process.exitCode = 1;
217+
} else {
218+
NodeFS.mkdirSync(NodePath.dirname(cachePath), { recursive: true });
219+
NodeFS.writeFileSync(cachePath, JSON.stringify({ key, summary }));
220+
}

0 commit comments

Comments
 (0)