diff --git a/src/utils/setup/setupChocoPack.ts b/src/utils/setup/setupChocoPack.ts index 9d6ec262..81998d21 100644 --- a/src/utils/setup/setupChocoPack.ts +++ b/src/utils/setup/setupChocoPack.ts @@ -1,11 +1,15 @@ +/* eslint-disable require-atomic-updates */ import { exec } from "@actions/exec" import which from "which" import { setupChocolatey } from "../../chocolatey/chocolatey" +let hasChoco = false + /** A function that installs a package using choco */ export async function setupChocoPack(name: string, version?: string) { - if (which.sync("choco", { nothrow: true }) === null) { + if (!hasChoco || which.sync("choco", { nothrow: true }) === null) { await setupChocolatey() + hasChoco = true } let exit