From 6dade5cb0cf6a39cb759150d1c0d69244757a47b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 17:50:19 -0500 Subject: [PATCH] fix: update repositories independent of add-apt-repository --- src/utils/setup/setupAptPack.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/setup/setupAptPack.ts b/src/utils/setup/setupAptPack.ts index 0904e56a..5313be29 100644 --- a/src/utils/setup/setupAptPack.ts +++ b/src/utils/setup/setupAptPack.ts @@ -15,11 +15,13 @@ export async function setupAptPack( let exit = 0 + if (typeof repository === "string") { + exit = await exec(mightSudo("add-apt-repository"), ["--update", repository]) + } + if (!didUpdate || repository === true) { await exec(apt, ["update"]) 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])