fix: skip apt initialization in subsequent calls

This commit is contained in:
Amin Yahyaabadi 2022-02-13 19:36:22 -08:00
parent 252db2e159
commit 69841cf764
3 changed files with 13 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

@ -29,6 +29,8 @@ export type InstallationInfo = {
binDir: string binDir: string
} }
let didInit: boolean = false
/** /**
* A function that: * A function that:
* *
@ -83,11 +85,15 @@ export async function setupBin(
if (!existsSync(binDir) || !existsSync(binFile)) { if (!existsSync(binDir) || !existsSync(binFile)) {
info(`Download and extract ${name} ${version}`) info(`Download and extract ${name} ${version}`)
if (process.platform === "linux") { if (!didInit) {
// extraction dependencies if (process.platform === "linux") {
await setupAptPack("unzip") // extraction dependencies
await setupAptPack("tar") await setupAptPack("unzip")
await setupAptPack("xz-utils") await setupAptPack("tar")
await setupAptPack("xz-utils")
}
// eslint-disable-next-line require-atomic-updates
didInit = true
} }
try { try {