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,12 +85,16 @@ 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 (!didInit) {
|
||||||
if (process.platform === "linux") {
|
if (process.platform === "linux") {
|
||||||
// extraction dependencies
|
// extraction dependencies
|
||||||
await setupAptPack("unzip")
|
await setupAptPack("unzip")
|
||||||
await setupAptPack("tar")
|
await setupAptPack("tar")
|
||||||
await setupAptPack("xz-utils")
|
await setupAptPack("xz-utils")
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line require-atomic-updates
|
||||||
|
didInit = true
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const downloaded = await downloadTool(url)
|
const downloaded = await downloadTool(url)
|
||||||
|
|
Loading…
Reference in New Issue