CLI: fix Windows gateway startup

This commit is contained in:
Tak hoffman
2026-01-22 22:11:15 -06:00
committed by Peter Steinberger
parent 9207840db4
commit b65916e0d1
2 changed files with 11 additions and 3 deletions

View File

@@ -94,9 +94,13 @@ export function buildParseArgv(params: {
: baseArgv[0]?.endsWith("clawdbot")
? baseArgv.slice(1)
: baseArgv;
const executable = normalizedArgv[0]?.split(/[/\\]/).pop() ?? "";
const executable = (normalizedArgv[0]?.split(/[/\\]/).pop() ?? "").toLowerCase();
const looksLikeNode =
normalizedArgv.length >= 2 && (executable === "node" || executable === "bun");
normalizedArgv.length >= 2 &&
(executable === "node" ||
executable === "node.exe" ||
executable === "bun" ||
executable === "bun.exe");
if (looksLikeNode) return normalizedArgv;
return ["node", programName || "clawdbot", ...normalizedArgv];
}