fix: fix apt version handling to fix gcc

This commit is contained in:
Amin Yahyaabadi 2021-09-16 17:56:35 -05:00
parent 6dade5cb0c
commit 48779980ad
1 changed files with 9 additions and 1 deletions

View File

@ -24,7 +24,15 @@ export async function setupAptPack(
didUpdate = true
}
exit = await exec(apt, ["install", version !== undefined && version !== "" ? `${name}=${version}` : name])
if (version !== undefined && version !== "") {
try {
exit = await exec(apt, ["install", `${name}=${version}`])
} catch {
exit = await exec(apt, ["install", `${name}-${version}`])
}
} else {
exit = await exec(apt, ["install", name])
}
if (exit !== 0) {
throw new Error(`Failed to install ${name} ${version}`)