( bin: string, args: string[], platform: NodeJS.Platform = process.platform, env: NodeJS.ProcessEnv = process.env, )
| 135 | } |
| 136 | |
| 137 | export function buildCliSpawnConfig( |
| 138 | bin: string, |
| 139 | args: string[], |
| 140 | platform: NodeJS.Platform = process.platform, |
| 141 | env: NodeJS.ProcessEnv = process.env, |
| 142 | ): CliSpawnConfig { |
| 143 | if (platform === "win32" && !path.isAbsolute(bin)) { |
| 144 | return { |
| 145 | command: resolveWindowsCliCommand(bin, env) || bin, |
| 146 | args, |
| 147 | shell: false, |
| 148 | }; |
| 149 | } |
| 150 | |
| 151 | return { command: bin, args, shell: false }; |
| 152 | } |
| 153 | |
| 154 | function parseLastJson<T>(stdout: string): T { |
| 155 | const lines = stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean); |
no test coverage detected