Commit 7885e2b
committed
Fix: resolve shell option on Windows to support .cmd/.bat shims
On Windows, Node.js spawn with shell:false cannot execute .cmd/.bat
shims — only native .exe binaries. The previous commit forced
shell:false for gh CLI invocations to prevent command injection, but
this regressed Windows setups where gh is installed as a .cmd shim
(e.g., via Scoop or corporate package managers).
Add resolveShellOption() in processRunner.ts that, on Windows, probes
PATH for the first matching file: if it's a .cmd/.bat shim, shell:true
is used (required for cmd.exe to interpret the shim); if it's an .exe,
shell:false is preserved (preventing injection). On non-Windows
platforms, the caller's explicit value is used (defaulting to false).1 parent 1fd6244 commit 7885e2b
1 file changed
+42
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
84 | 125 | | |
85 | 126 | | |
86 | 127 | | |
| |||
140 | 181 | | |
141 | 182 | | |
142 | 183 | | |
143 | | - | |
| 184 | + | |
144 | 185 | | |
145 | 186 | | |
146 | 187 | | |
| |||
0 commit comments