From 78ad81e39396df0532e209c0152496162bf36064 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 17 Sep 2021 04:55:20 -0500 Subject: [PATCH] fix: fix gcc on windows --- src/gcc/gcc.ts | 2 ++ src/utils/setup/setupChocoPack.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gcc/gcc.ts b/src/gcc/gcc.ts index db43174d..fe31008f 100644 --- a/src/gcc/gcc.ts +++ b/src/gcc/gcc.ts @@ -21,6 +21,8 @@ export async function setupGcc(version: string, _setupCppDir: string, arch: stri } else if (arch === "ia32" && existsSync("C:/tools/mingw32/bin")) { binDir = "C:/tools/mingw32/bin" addPath(binDir) + } else if (existsSync("C:/ProgramData/Chocolatey/bin/g++.exe")) { + binDir = "C:/ProgramData/Chocolatey/bin/g++.exe" } break } diff --git a/src/utils/setup/setupChocoPack.ts b/src/utils/setup/setupChocoPack.ts index a2f3813f..abda5867 100644 --- a/src/utils/setup/setupChocoPack.ts +++ b/src/utils/setup/setupChocoPack.ts @@ -1,4 +1,5 @@ /* eslint-disable require-atomic-updates */ +import { addPath } from "@actions/core" import { exec } from "@actions/exec" import which from "which" 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}`) } - return { binDir: "C:/ProgramData/Chocolatey/bin/" } + const binDir = "C:/ProgramData/Chocolatey/bin/" + addPath(binDir) + return { binDir } }