Skip to content

Commit 4b6411c

Browse files
authored
Merge pull request #76 from aminya/windows-unzip [skip ci]
2 parents f815a5c + ee437a5 commit 4b6411c

File tree

8 files changed

+49
-34
lines changed

8 files changed

+49
-34
lines changed

dist/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/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.

pnpm-lock.yaml

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmake/cmake.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { extractZip, extractTar } from "@actions/tool-cache"
1+
import { extractTar } from "@actions/tool-cache"
22
import semverLte from "semver/functions/lte"
33
import semverCoerce from "semver/functions/coerce"
44
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
55
import { addBinExtension } from "../utils/extension/extension"
6+
import { extractZip } from "../utils/setup/extract"
67

78
/** Get the platform data for cmake */
89
function getCmakePackageInfo(version: string, platform: NodeJS.Platform, arch: string): PackageInfo {

src/doxygen/doxygen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
4646
try {
4747
// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
4848
installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
49+
setupAptPack("libclang-cpp9")
4950
} catch (err) {
5051
notice(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)
5152
installationInfo = setupAptPack("doxygen", undefined)

src/ninja/ninja.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { extractZip } from "@actions/tool-cache"
21
import { addBinExtension } from "../utils/extension/extension"
2+
import { extractZip } from "../utils/setup/extract"
33
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
44

55
/** Get the platform name Ninja uses in their download links */

src/task/task.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { extractZip } from "@actions/tool-cache"
21
import { addBinExtension } from "../utils/extension/extension"
3-
import { extractTarByExe } from "../utils/setup/extract"
2+
import { extractTarByExe, extractZip } from "../utils/setup/extract"
43
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
54

65
/** Get the platform name task uses in their download links */

src/utils/setup/extract.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,36 @@ import { mkdirP } from "@actions/io"
33
import which from "which"
44
import { setupSevenZip } from "../../sevenzip/sevenzip"
55
import { warning } from "../io/io"
6-
export { extractTar, extractXar, extract7z, extractZip } from "@actions/tool-cache"
6+
export { extractTar, extractXar } from "@actions/tool-cache"
77

88
let sevenZip: string | undefined
99

10-
export async function extractExe(file: string, dest: string) {
11-
// install 7z if needed
10+
/// Extract 7z using 7z
11+
export async function extract7Zip(file: string, dest: string) {
12+
await execa(await getSevenZip(), ["x", file, `-o${dest}`], { stdio: "inherit" })
13+
return dest
14+
}
15+
16+
/// install 7z if needed
17+
async function getSevenZip() {
1218
if (sevenZip === undefined) {
1319
if (which.sync("7z", { nothrow: true }) === null) {
1420
await setupSevenZip("", "", process.arch)
1521
}
1622
// eslint-disable-next-line require-atomic-updates
1723
sevenZip = "7z"
1824
}
25+
return sevenZip
26+
}
1927

20-
await execa(sevenZip, ["x", file, `-o${dest}`], { stdio: "inherit" })
21-
return dest
28+
/// Extract Exe using 7z
29+
export async function extractExe(file: string, dest: string) {
30+
return extract7Zip(file, dest)
31+
}
32+
33+
/// Extract Zip using 7z
34+
export async function extractZip(file: string, dest: string) {
35+
return extract7Zip(file, dest)
2236
}
2337

2438
export async function extractTarByExe(file: string, dest: string, flags = ["--strip-components=0"]) {

0 commit comments

Comments
 (0)