fix: use strip-components 0 in extractTarByExe

This commit is contained in:
Amin Yahyaabadi 2022-01-30 18:36:25 -08:00
parent 1e1a2c7082
commit eb3db26bf7
5 changed files with 10 additions and 7 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -20,9 +20,7 @@ function getKcovPackageInfo(version: string): PackageInfo {
extractedFolderName: "",
binRelativeDir: "usr/local/bin",
binFileName: addBinExtension("kcov"),
extractFunction: (file: string, dest: string) => {
return extractTarByExe(file, dest, ["--strip-components=0"])
},
extractFunction: extractTarByExe,
}
} else {
return {

View File

@ -231,7 +231,12 @@ async function getLLVMPackageInfo(version: string, platform: NodeJS.Platform, _a
extractedFolderName: "",
binRelativeDir: "bin",
binFileName: addBinExtension("clang"),
extractFunction: platform === "win32" ? extractExe : extractTarByExe,
extractFunction:
platform === "win32"
? extractExe
: (file: string, dest: string) => {
return extractTarByExe(file, dest, ["--strip-components=1"])
},
}
}

View File

@ -7,7 +7,7 @@ export async function extractExe(file: string, dest: string) {
return dest
}
export async function extractTarByExe(file: string, dest: string, flags = ["--strip-components=1"]) {
export async function extractTarByExe(file: string, dest: string, flags = ["--strip-components=0"]) {
try {
await mkdirP(dest)
} catch {