Skip to content

Commit 78ad81e

Browse files
committed
fix: fix gcc on windows
1 parent ca064b6 commit 78ad81e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/gcc/gcc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export async function setupGcc(version: string, _setupCppDir: string, arch: stri
2121
} else if (arch === "ia32" && existsSync("C:/tools/mingw32/bin")) {
2222
binDir = "C:/tools/mingw32/bin"
2323
addPath(binDir)
24+
} else if (existsSync("C:/ProgramData/Chocolatey/bin/g++.exe")) {
25+
binDir = "C:/ProgramData/Chocolatey/bin/g++.exe"
2426
}
2527
break
2628
}

src/utils/setup/setupChocoPack.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable require-atomic-updates */
2+
import { addPath } from "@actions/core"
23
import { exec } from "@actions/exec"
34
import which from "which"
45
import { setupChocolatey } from "../../chocolatey/chocolatey"
@@ -24,5 +25,7 @@ export async function setupChocoPack(name: string, version?: string, args: strin
2425
throw new Error(`Failed to install ${name} ${version}`)
2526
}
2627

27-
return { binDir: "C:/ProgramData/Chocolatey/bin/" }
28+
const binDir = "C:/ProgramData/Chocolatey/bin/"
29+
addPath(binDir)
30+
return { binDir }
2831
}

0 commit comments

Comments
 (0)