Skip to content

Commit

Permalink
Merge pull request #287 from aminya/unzip-windows [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored Sep 10, 2024
2 parents 5e68b68 + 01e15ae commit 691fa79
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/utils/setup/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,19 @@ export function extractExe(file: string, dest: string) {

/// Extract Zip using unzip or 7z
export async function extractZip(file: string, dest: string) {
// if unzip is available use it
// prefer 7z if available (faster especially on Windows)
if (which.sync("7z", { nothrow: true }) !== null) {
return extract7Zip(file, dest)
}

// if unzip is available use it (usually available on posix systems)
if (which.sync("unzip", { nothrow: true }) !== null) {
await execa("unzip", ["-q", file, "-d", dest], { stdio: "inherit" })
await grantUserWriteAccess(dest)
return dest
}

// fallback to 7z (will install 7z if needed)
return extract7Zip(file, dest)
}

Expand Down

0 comments on commit 691fa79

Please sign in to comment.