Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Fix ChildProcess.spawn failing on Windows for .cmd shims (#495)

(CJ) Chukwudi Nwobodob7f954a9041e
diff --git a/apps/server/scripts/cli.ts b/apps/server/scripts/cli.ts
index e5b5c0d00..3eaa72ea8 100644
--- a/apps/server/scripts/cli.ts
+++ b/apps/server/scripts/cli.ts
@@ -132,6 +132,7 @@ const buildCmd = Command.make(
cwd: serverDir,
stdout: config.verbose ? "inherit" : "ignore",
stderr: "inherit",
+ // Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd).
shell: process.platform === "win32",
})`bun tsdown`,
);
@@ -226,6 +227,7 @@ const publishCmd = Command.make(
cwd: serverDir,
stdout: config.verbose ? "inherit" : "ignore",
stderr: "inherit",
+ // Windows needs shell mode to resolve .cmd shims.
shell: process.platform === "win32",
}),
);
diff --git a/scripts/build-desktop-artifact.ts b/scripts/build-desktop-artifact.ts
index 8823b8851..c44109fae 100644
--- a/scripts/build-desktop-artifact.ts
+++ b/scripts/build-desktop-artifact.ts
@@ -580,6 +580,8 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
ChildProcess.make({
cwd: repoRoot,
...commandOutputOptions(options.verbose),
+ // Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd).
+ shell: process.platform === "win32",
})`bun run build:desktop`,
);
}
@@ -642,6 +644,8 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
ChildProcess.make({
cwd: stageAppDir,
...commandOutputOptions(options.verbose),
+ // Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd).
+ shell: process.platform === "win32",
})`bun install --production`,
);
@@ -680,6 +684,8 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
cwd: stageAppDir,
env: buildEnv,
...commandOutputOptions(options.verbose),
+ // Windows needs shell mode to resolve .cmd shims.
+ shell: process.platform === "win32",
})`bunx electron-builder ${platformConfig.cliFlag} --${options.arch} --publish never`,
);
diff --git a/scripts/dev-runner.ts b/scripts/dev-runner.ts
index c72411e31..89d7a104c 100644
--- a/scripts/dev-runner.ts
+++ b/scripts/dev-runner.ts
@@ -455,6 +455,8 @@ export function runDevRunnerWithInput(input: DevRunnerCliInput) {
stderr: "inherit",
env,
extendEnv: false,
+ // Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd).
+ shell: process.platform === "win32",
// Keep turbo in the same process group so terminal signals (Ctrl+C)
// reach it directly. Effect defaults to detached: true on non-Windows,
// which would put turbo in a new group and require manual forwarding.