(platform: NodeJS.Platform)
| 20 | } |
| 21 | |
| 22 | function defaultIsCommandAvailable(platform: NodeJS.Platform): (command: string) => boolean { |
| 23 | return (command: string) => { |
| 24 | if (!command) return false; |
| 25 | |
| 26 | try { |
| 27 | const result = spawnSync(platform === "win32" ? "where" : "which", [command], { |
| 28 | stdio: "ignore", |
| 29 | }); |
| 30 | return result.status === 0; |
| 31 | } catch { |
| 32 | return false; |
| 33 | } |
| 34 | }; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Check whether a path-like shell candidate is a real executable file. |
no outgoing calls
no test coverage detected