mirror of https://github.com/aminya/setup-cpp
fix: fix apt version handling to fix gcc
This commit is contained in:
parent
6dade5cb0c
commit
48779980ad
|
@ -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}`)
|
||||
|
|
Loading…
Reference in New Issue