( commandPath: string, platform: Platform = process.platform, )
| 61 | } |
| 62 | |
| 63 | export function shouldSpawnViaShell( |
| 64 | commandPath: string, |
| 65 | platform: Platform = process.platform, |
| 66 | ): boolean { |
| 67 | if (platform !== "win32") return false; |
| 68 | const ext = getKnownWindowsExtension(commandPath); |
| 69 | return ext ? WINDOWS_SHELL_EXTENSIONS.has(ext) : false; |
| 70 | } |
| 71 | |
| 72 | function quoteWindowsShellArg(arg: string): string { |
| 73 | if (!arg || /[\s"&()^|<>]/.test(arg)) { |
no test coverage detected