fix: add shell: true on Windows so spawnSync can resolve .cmd shims (#13)
On Windows, Node.js `spawnSync` without `shell: true` uses
`CreateProcess`, which only resolves `.exe` files. npm installs global
tools (like `codex`) as `.cmd` shims, so `spawnSync("codex", ...)`
returns ENOENT even when codex is correctly installed and on PATH.
Adding `shell: process.platform === "win32"` routes through `cmd.exe`
on Windows, which properly resolves `.cmd`, `.bat`, and PATHEXT entries.
No behavior change on macOS/Linux since the condition evaluates to false.
This commit is contained in:
parent
f4d65d9641
commit
cf6f8515d8
@ -7,7 +7,8 @@ export function runCommand(command, args = [], options = {}) {
|
||||
env: options.env,
|
||||
encoding: "utf8",
|
||||
input: options.input,
|
||||
stdio: options.stdio ?? "pipe"
|
||||
stdio: options.stdio ?? "pipe",
|
||||
shell: process.platform === "win32"
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user