( command, platform = process.platform, lookup = whereCommandLookup, )
| 52 | * fails. |
| 53 | */ |
| 54 | export function resolveWindowsCommand( |
| 55 | command, |
| 56 | platform = process.platform, |
| 57 | lookup = whereCommandLookup, |
| 58 | ) { |
| 59 | if (platform !== "win32") { |
| 60 | return command; |
| 61 | } |
| 62 | if (command.includes("/") || command.includes("\\")) { |
| 63 | return command; |
| 64 | } |
| 65 | return lookup(command) || command; |
| 66 | } |
| 67 | |
| 68 | function whereCommandLookup(command) { |
| 69 | const result = spawnSync("where.exe", [command], { encoding: "utf8" }); |
no test coverage detected