mirror of https://github.com/aminya/setup-cpp
perf: skip 7z installation if found
This commit is contained in:
parent
fc877ac81b
commit
954f03e554
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -9,13 +9,14 @@ let sevenZip: string | undefined
|
|||
export async function extractExe(file: string, dest: string) {
|
||||
// install 7z if needed
|
||||
if (sevenZip === undefined) {
|
||||
if (which.sync("7z", { nothrow: true }) !== null) {
|
||||
sevenZip = "7z"
|
||||
}
|
||||
if (which.sync("7z", { nothrow: true }) === null) {
|
||||
await setupSevenZip("", "", process.arch)
|
||||
}
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
sevenZip = "7z"
|
||||
}
|
||||
|
||||
await execa("7z", ["x", file, `-o${dest}`])
|
||||
await execa(sevenZip, ["x", file, `-o${dest}`])
|
||||
return dest
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue