fix(update): merge custom env with process.env in spawn

When the update runner passes custom env vars (like CLAWDBOT_UPDATE_IN_PROGRESS),
the current code uses `env ?? process.env` which replaces the entire environment
instead of merging — losing PATH, HOME, etc.

This causes the doctor step to fail with 'node: No such file or directory'.

Fix: merge custom env with process.env instead of replacing it.
This commit is contained in:
danielz1z
2026-01-11 07:33:03 +00:00
committed by Peter Steinberger
parent 11a3b5aac9
commit 4570e1db7d

View File

@@ -66,7 +66,7 @@ export async function runCommandWithTimeout(
const child = spawn(argv[0], argv.slice(1), {
stdio: [hasInput ? "pipe" : "inherit", "pipe", "pipe"],
cwd,
env: env ?? process.env,
env: env ? { ...process.env, ...env } : process.env,
});
let stdout = "";
let stderr = "";