From 62ec9512c9203fa3b53f643f838d8ddcef27f229 Mon Sep 17 00:00:00 2001 From: masayan-kazu Date: Tue, 31 Mar 2026 10:37:28 +0900 Subject: [PATCH] fix: add shell:true for binaryAvailable on Windows spawnSync cannot resolve .cmd wrappers (npm, codex) without shell:true on Windows, causing /codex:setup to report them as missing. Fixes #17 --- plugins/codex/scripts/lib/process.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/codex/scripts/lib/process.mjs b/plugins/codex/scripts/lib/process.mjs index 000ecd2..f65931d 100644 --- a/plugins/codex/scripts/lib/process.mjs +++ b/plugins/codex/scripts/lib/process.mjs @@ -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: options.shell ?? false }); return { @@ -33,7 +34,8 @@ export function runCommandChecked(command, args = [], options = {}) { } export function binaryAvailable(command, versionArgs = ["--version"], options = {}) { - const result = runCommand(command, versionArgs, options); + const platformOptions = process.platform === "win32" ? { ...options, shell: true } : options; + const result = runCommand(command, versionArgs, platformOptions); if (result.error && /** @type {NodeJS.ErrnoException} */ (result.error).code === "ENOENT") { return { available: false, detail: "not found" }; }