fix: use ChocolateyInstall for gcc installation path on Windows

This commit is contained in:
Amin Yahyaabadi 2022-01-30 17:49:30 -08:00
parent 625ffbd77f
commit b43302cf75
3 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

@ -24,8 +24,8 @@ export async function setupGcc(version: string, _setupDir: string, arch: string)
} else if (arch === "ia32" && existsSync("C:/tools/mingw32/bin")) { } else if (arch === "ia32" && existsSync("C:/tools/mingw32/bin")) {
binDir = "C:/tools/mingw32/bin" binDir = "C:/tools/mingw32/bin"
addPath(binDir) addPath(binDir)
} else if (existsSync("C:/ProgramData/Chocolatey/bin/g++.exe")) { } else if (existsSync(`${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin/g++.exe`)) {
binDir = "C:/ProgramData/Chocolatey/bin/" binDir = `${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin`
} }
break break
} }