fix: fix gcc on windows

This commit is contained in:
Amin Yahyaabadi 2021-09-17 04:55:20 -05:00
parent ca064b68e0
commit 78ad81e393
2 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,8 @@ export async function setupGcc(version: string, _setupCppDir: string, arch: stri
} 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")) {
binDir = "C:/ProgramData/Chocolatey/bin/g++.exe"
} }
break break
} }

View File

@ -1,4 +1,5 @@
/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */
import { addPath } from "@actions/core"
import { exec } from "@actions/exec" import { exec } from "@actions/exec"
import which from "which" import which from "which"
import { setupChocolatey } from "../../chocolatey/chocolatey" import { setupChocolatey } from "../../chocolatey/chocolatey"
@ -24,5 +25,7 @@ export async function setupChocoPack(name: string, version?: string, args: strin
throw new Error(`Failed to install ${name} ${version}`) throw new Error(`Failed to install ${name} ${version}`)
} }
return { binDir: "C:/ProgramData/Chocolatey/bin/" } const binDir = "C:/ProgramData/Chocolatey/bin/"
addPath(binDir)
return { binDir }
} }