Skip to content

Commit 4c29550

Browse files
committed
fix windows
1 parent a40f443 commit 4c29550

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

workspaces/util/src/execWithArgs.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ export function execWithArgs(
1717
): Promise<ExecWithArgsResult> {
1818
return new Promise((resolve, reject) => {
1919
const childProcess = spawn(command, args, {
20+
// TODO: share code between this callsite and spawnWithSafeStdio
21+
22+
// Without a shell specified, many comands seem to fail to spawn on
23+
// Windows. I verified that it's not a PATH issue. It seems like it's
24+
// probably https://github.com/nodejs/node-v0.x-archive/issues/5841
25+
...(process.platform === "win32" && { shell: "bash" }),
26+
2027
...options,
28+
2129
stdio: ["ignore", "pipe", "pipe"],
2230
});
2331

workspaces/util/src/spawnWithSafeStdio.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import process from "node:process";
22
import { spawn, type SpawnOptions } from "node:child_process";
33

4-
// TODO: audit callsites since the behavior is changing
4+
// TODO: audit callsites since the behavior changed recently
55

66
export function spawnWithSafeStdio(
77
command: string,
@@ -17,7 +17,7 @@ export function spawnWithSafeStdio(
1717
// Without a shell specified, many comands seem to fail to spawn on
1818
// Windows. I verified that it's not a PATH issue. It seems like it's
1919
// probably https://github.com/nodejs/node-v0.x-archive/issues/5841
20-
...(process.platform === "win32" && { shell: options?.shell ?? "bash" }),
20+
...(process.platform === "win32" && { shell: "bash" }),
2121

2222
...options,
2323
});

0 commit comments

Comments
 (0)