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