fix: use ChocolateyInstall env variable

This commit is contained in:
Amin Yahyaabadi 2022-01-30 14:40:42 -08:00
parent 4b0650a08c
commit 0fe9b461ac
4 changed files with 4 additions and 4 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -56,7 +56,7 @@ export function setupChocolatey(
if (maybeChoco !== null) {
binDir = dirname(maybeChoco)
} else {
binDir = "C:/ProgramData/Chocolatey/bin/"
binDir = `${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin`
}
if (existsSync(binDir)) {

View File

@ -28,7 +28,7 @@ export function setupChocoPack(name: string, version?: string, args: string[] =
execa.sync("choco", ["install", "-y", name, ...args], { env, extendEnv: false })
}
const binDir = "C:/ProgramData/Chocolatey/bin/"
const binDir = `${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin`
addPath(binDir)
return { binDir }
}