From ae39a8d7d26f4a326f81694e5e99ed009d312fdf Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Tue, 24 Mar 2020 18:49:35 +0100 Subject: [PATCH] Deduplicate the list of path entries for MSYS2 --- dist/index.js | 8 +++----- windows.js | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index ecb359f..976f3bf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4809,6 +4809,7 @@ const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem' // standard MSYS2 location, found by 'devkit' const msys2 = 'C:\\msys64' +const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`] function getAvailableVersions(platform, engine) { if (engine === 'ruby') { @@ -4869,7 +4870,7 @@ async function setupMingw(version) { await symLinkToEmbeddedMSYS2() } - return [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`] + return msys2PathEntries } async function setupMSWin() { @@ -4890,10 +4891,7 @@ async function setupMSWin() { await symLinkToEmbeddedMSYS2() } - let pathAry = addVCVARSEnv() - // add MSYS2 paths for misc gnu utilities like bison and ragel - pathAry.push(`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`) - return pathAry + return [...addVCVARSEnv(), ...msys2PathEntries] } /* Sets MSVC environment for use in Actions diff --git a/windows.js b/windows.js index 733781c..9111b91 100644 --- a/windows.js +++ b/windows.js @@ -13,6 +13,7 @@ const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem' // standard MSYS2 location, found by 'devkit' const msys2 = 'C:\\msys64' +const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`] export function getAvailableVersions(platform, engine) { if (engine === 'ruby') { @@ -73,7 +74,7 @@ async function setupMingw(version) { await symLinkToEmbeddedMSYS2() } - return [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`] + return msys2PathEntries } async function setupMSWin() { @@ -94,10 +95,7 @@ async function setupMSWin() { await symLinkToEmbeddedMSYS2() } - let pathAry = addVCVARSEnv() - // add MSYS2 paths for misc gnu utilities like bison and ragel - pathAry.push(`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`) - return pathAry + return [...addVCVARSEnv(), ...msys2PathEntries] } /* Sets MSVC environment for use in Actions