|
1 | 1 | import path from "path" |
2 | 2 | import { Process } from "./process" |
3 | 3 |
|
4 | | -export namespace Archive { |
5 | | - export async function extractZip(zipPath: string, destDir: string) { |
6 | | - if (process.platform === "win32") { |
7 | | - const winZipPath = path.resolve(zipPath) |
8 | | - const winDestDir = path.resolve(destDir) |
9 | | - // $global:ProgressPreference suppresses PowerShell's blue progress bar popup |
10 | | - const cmd = `$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path '${winZipPath}' -DestinationPath '${winDestDir}' -Force` |
11 | | - await Process.run(["powershell", "-NoProfile", "-NonInteractive", "-Command", cmd]) |
12 | | - return |
13 | | - } |
14 | | - |
15 | | - await Process.run(["unzip", "-o", "-q", zipPath, "-d", destDir]) |
| 4 | +export async function extractZip(zipPath: string, destDir: string) { |
| 5 | + if (process.platform === "win32") { |
| 6 | + const winZipPath = path.resolve(zipPath) |
| 7 | + const winDestDir = path.resolve(destDir) |
| 8 | + // $global:ProgressPreference suppresses PowerShell's blue progress bar popup |
| 9 | + const cmd = `$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path '${winZipPath}' -DestinationPath '${winDestDir}' -Force` |
| 10 | + await Process.run(["powershell", "-NoProfile", "-NonInteractive", "-Command", cmd]) |
| 11 | + return |
16 | 12 | } |
| 13 | + |
| 14 | + await Process.run(["unzip", "-o", "-q", zipPath, "-d", destDir]) |
17 | 15 | } |
0 commit comments