mirror of https://github.com/aminya/setup-cpp
fix: skip apt initialization in subsequent calls
This commit is contained in:
parent
252db2e159
commit
69841cf764
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue