* Escapes arguments for shell-mode spawns: applies escapeWindowsShellArg * when the platform is `win32` (where `shell: true` routes through `cmd.exe`) * and returns the arguments untouched everywhere else.
( args: ReadonlyArray<string>, platform: NodeJS.Platform, )
| 75 | * and returns the arguments untouched everywhere else. |
| 76 | */ |
| 77 | function sanitizeShellModeArgsForPlatform( |
| 78 | args: ReadonlyArray<string>, |
| 79 | platform: NodeJS.Platform, |
| 80 | ): Array<string> { |
| 81 | return platform === "win32" ? args.map(escapeWindowsShellArg) : [...args]; |
| 82 | } |
| 83 | |
| 84 | export interface ResolvedSpawnCommand { |
| 85 | readonly command: string; |