fix: update repositories independent of add-apt-repository

This commit is contained in:
Amin Yahyaabadi 2021-09-16 17:50:19 -05:00
parent 6925e1f02c
commit 6dade5cb0c
1 changed files with 4 additions and 2 deletions

View File

@ -15,11 +15,13 @@ export async function setupAptPack(
let exit = 0 let exit = 0
if (typeof repository === "string") {
exit = await exec(mightSudo("add-apt-repository"), ["--update", repository])
}
if (!didUpdate || repository === true) { if (!didUpdate || repository === true) {
await exec(apt, ["update"]) await exec(apt, ["update"])
didUpdate = true didUpdate = true
} else if (typeof repository === "string") {
exit = await exec(mightSudo("add-apt-repository"), ["--update", repository])
} }
exit = await exec(apt, ["install", version !== undefined && version !== "" ? `${name}=${version}` : name]) exit = await exec(apt, ["install", version !== undefined && version !== "" ? `${name}=${version}` : name])