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

@@ -115,7 +115,11 @@ if (!shouldBuild()) {
runNode(); runNode();
} else { } else {
logRunner("Building TypeScript (dist is stale)."); logRunner("Building TypeScript (dist is stale).");
const build = spawn("pnpm", ["exec", compiler, ...projectArgs], { const pnpmArgs = ["exec", compiler, ...projectArgs];
const buildCmd = process.platform === "win32" ? "cmd.exe" : "pnpm";
const buildArgs =
process.platform === "win32" ? ["/d", "/s", "/c", "pnpm", ...pnpmArgs] : pnpmArgs;
const build = spawn(buildCmd, buildArgs, {
cwd, cwd,
env, env,
stdio: "inherit", stdio: "inherit",

View File

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