(bin: string, env: NodeJS.ProcessEnv = process.env)
| 119 | } |
| 120 | |
| 121 | export function resolveWindowsCliCommand(bin: string, env: NodeJS.ProcessEnv = process.env): string | undefined { |
| 122 | const pathValue = env.PATH || ""; |
| 123 | if (!pathValue) return undefined; |
| 124 | |
| 125 | const candidates = getWindowsPathCandidates(bin, env); |
| 126 | for (const dir of pathValue.split(path.delimiter)) { |
| 127 | if (!dir) continue; |
| 128 | for (const candidate of candidates) { |
| 129 | const fullPath = path.join(dir, candidate); |
| 130 | if (existsSync(fullPath)) return fullPath; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | return undefined; |
| 135 | } |
| 136 | |
| 137 | export function buildCliSpawnConfig( |
| 138 | bin: string, |
no test coverage detected