Browse Source

Merge pull request #859 from Zhanyuanium/fix/windows-opencode-detection

fix: skip shell wrapper for .exe files in canExecute on Windows
Alvin 2 weeks ago
parent
commit
6b0e76ece9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/cli/system.ts

+ 1 - 1
src/cli/system.ts

@@ -61,7 +61,7 @@ function canExecute(
       env: environment,
       env: environment,
       // Required on Windows to execute .cmd/.bat shims produced by npm/pnpm/yarn
       // Required on Windows to execute .cmd/.bat shims produced by npm/pnpm/yarn
       // (Node's CVE-2024-27980 patch blocks them without a shell).
       // (Node's CVE-2024-27980 patch blocks them without a shell).
-      shell: isWindows,
+      shell: isWindows && !/\.exe$/i.test(command),
     });
     });
     return result.status === 0;
     return result.status === 0;
   } catch {
   } catch {