| 19 | } |
| 20 | |
| 21 | private async unzipUsing7Zip(zipPath: string, destination: string) { |
| 22 | debug(`Using 7zip to extract ${zipPath} to ${destination}`); |
| 23 | const path7Zip = await which("7z.exe", true); |
| 24 | const exitCode = await exec(`${path7Zip} x -o${destination} ${zipPath}`); |
| 25 | if (exitCode != 0) { |
| 26 | throw new Error(`Extraction using 7zip failed from ${zipPath} to ${destination}`); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | private async unzipUsingPowerShell(zipPath: string, destination: string) { |
| 31 | debug(`Using powershell Expand-Archive cmdlet to extract ${zipPath} to ${destination}`); |