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: "", extractedFolderName: "",
binRelativeDir: "usr/local/bin", binRelativeDir: "usr/local/bin",
binFileName: addBinExtension("kcov"), binFileName: addBinExtension("kcov"),
extractFunction: (file: string, dest: string) => { extractFunction: extractTarByExe,
return extractTarByExe(file, dest, ["--strip-components=0"])
},
} }
} else { } else {
return { return {

View File

@ -231,7 +231,12 @@ async function getLLVMPackageInfo(version: string, platform: NodeJS.Platform, _a
extractedFolderName: "", extractedFolderName: "",
binRelativeDir: "bin", binRelativeDir: "bin",
binFileName: addBinExtension("clang"), 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 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 { try {
await mkdirP(dest) await mkdirP(dest)
} catch { } catch {