Skip to content

Commit 691fa79

Browse files
authored
Merge pull request #287 from aminya/unzip-windows [skip ci]
2 parents 5e68b68 + 01e15ae commit 691fa79

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

dist/legacy/setup-cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/setup/extract.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,19 @@ export function extractExe(file: string, dest: string) {
9090

9191
/// Extract Zip using unzip or 7z
9292
export async function extractZip(file: string, dest: string) {
93-
// if unzip is available use it
93+
// prefer 7z if available (faster especially on Windows)
94+
if (which.sync("7z", { nothrow: true }) !== null) {
95+
return extract7Zip(file, dest)
96+
}
97+
98+
// if unzip is available use it (usually available on posix systems)
9499
if (which.sync("unzip", { nothrow: true }) !== null) {
95100
await execa("unzip", ["-q", file, "-d", dest], { stdio: "inherit" })
96101
await grantUserWriteAccess(dest)
97102
return dest
98103
}
99104

105+
// fallback to 7z (will install 7z if needed)
100106
return extract7Zip(file, dest)
101107
}
102108

0 commit comments

Comments
 (0)