( args: readonly string[], platform: NodeJS.Platform = process.platform, )
| 4 | }; |
| 5 | |
| 6 | export function buildNpxCommand( |
| 7 | args: readonly string[], |
| 8 | platform: NodeJS.Platform = process.platform, |
| 9 | ): NpxCommand { |
| 10 | if (platform === "win32") { |
| 11 | // npm installs npx as a .cmd shim on Windows; invoke it through cmd.exe |
| 12 | // instead of relying on child_process to resolve or execute the shim. |
| 13 | return { command: "cmd.exe", args: ["/d", "/s", "/c", "npx.cmd", ...args] }; |
| 14 | } |
| 15 | |
| 16 | return { command: "npx", args: [...args] }; |
| 17 | } |
no outgoing calls
no test coverage detected