(command: string, args: readonly string[])
| 173 | } |
| 174 | |
| 175 | function runExtractionCommand(command: string, args: readonly string[]): void { |
| 176 | const result = spawnSync(command, [...args], { stdio: 'pipe' }); |
| 177 | if (!result.error && result.status === 0) return; |
| 178 | const stderr = result.stderr.toString().trim(); |
| 179 | const detail = |
| 180 | result.error?.message ?? (stderr.length > 0 ? stderr : `exit status ${String(result.status)}`); |
| 181 | throw new Error(`Failed to extract fd with ${command}: ${detail}`); |
| 182 | } |
| 183 | |
| 184 | function getWindowsTarCommand(): string { |
| 185 | const systemRoot = process.env['SystemRoot'] ?? process.env['WINDIR']; |
no test coverage detected