Skip to content

Commit 69841cf

Browse files
committed
fix: skip apt initialization in subsequent calls
1 parent 252db2e commit 69841cf

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
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.

src/utils/setup/setupBin.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export type InstallationInfo = {
2929
binDir: string
3030
}
3131

32+
let didInit: boolean = false
33+
3234
/**
3335
* A function that:
3436
*
@@ -83,11 +85,15 @@ export async function setupBin(
8385
if (!existsSync(binDir) || !existsSync(binFile)) {
8486
info(`Download and extract ${name} ${version}`)
8587

86-
if (process.platform === "linux") {
87-
// extraction dependencies
88-
await setupAptPack("unzip")
89-
await setupAptPack("tar")
90-
await setupAptPack("xz-utils")
88+
if (!didInit) {
89+
if (process.platform === "linux") {
90+
// extraction dependencies
91+
await setupAptPack("unzip")
92+
await setupAptPack("tar")
93+
await setupAptPack("xz-utils")
94+
}
95+
// eslint-disable-next-line require-atomic-updates
96+
didInit = true
9197
}
9298

9399
try {

0 commit comments

Comments
 (0)