Skip to content

Commit a4dae96

Browse files
silverwindclaude
andcommitted
Fix race condition causing double JSON output on Windows
The unawaited finishWithMessage calls allowed execution to fall through to outputDeps, producing two JSON objects on stdout when the async exit was delayed by the Windows flush workaround. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 96a435e commit a4dae96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,7 @@ async function main(): Promise<void> {
18101810
}
18111811
}
18121812
if (numDependencies === 0) {
1813-
finishWithMessage("No dependencies found, nothing to do.");
1813+
return finishWithMessage("No dependencies found, nothing to do.");
18141814
}
18151815
18161816
let numEntries = 0;
@@ -1819,7 +1819,7 @@ async function main(): Promise<void> {
18191819
}
18201820
18211821
if (!numEntries) {
1822-
finishWithMessage("All dependencies are up to date.");
1822+
return finishWithMessage("All dependencies are up to date.");
18231823
}
18241824
18251825
const exitCode = outputDeps(deps);

0 commit comments

Comments
 (0)