From a9e63280c3c776e9a1d46dfd45d34eb978929964 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 15:13:55 -0500 Subject: [PATCH] fix: check if mingw paths exists --- src/gcc/gcc.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gcc/gcc.ts b/src/gcc/gcc.ts index cc18ad81..ba580fde 100644 --- a/src/gcc/gcc.ts +++ b/src/gcc/gcc.ts @@ -1,4 +1,5 @@ import { addPath } from "@actions/core" +import { existsSync } from "fs" import { setupAptPack } from "../utils/setup/setupAptPack" import { setupBrewPack } from "../utils/setup/setupBrewPack" import { setupChocoPack } from "../utils/setup/setupChocoPack" @@ -12,11 +13,11 @@ export async function setupGcc(version: string, _setupCppDir: string, arch: stri } await setupChocoPack("mingw", version) let binDir: string | undefined - if (arch === "x64") { + if (arch === "x64" && existsSync("C:\\tools\\mingw64\\bin")) { binDir = "C:\\tools\\mingw64\\bin" addPath(binDir) return { binDir } - } else if (arch === "ia32") { + } else if (arch === "ia32" && existsSync("C:\\tools\\mingw32\\bin")) { binDir = "C:\\tools\\mingw32\\bin" addPath(binDir) return { binDir }