Fix cn check workers exiting with code 1

Intercept --internal-check-worker flag before program.parse() so forked
worker subprocesses route to runCheckWorker() instead of hitting the
unknown command handler.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Nate 2026-02-02 01:58:11 -08:00
parent 46b04cad4e
commit 5534789dc0

View file

@ -444,6 +444,13 @@ program.on("command:*", () => {
});
export async function runCli(): Promise<void> {
// Handle internal worker subprocess for cn check
if (process.argv.includes("--internal-check-worker")) {
const { runCheckWorker } = await import("./commands/check/checkWorker.js");
await runCheckWorker();
return;
}
// Parse arguments and handle errors
try {
program.parse();