diff --git a/dist/index.js b/dist/index.js index bed77fae4..7b5f730be 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7929,7 +7929,8 @@ async function linkMSYS2() { } function setupPath(msys2, rubyPrefix) { - let path = process.env['PATH'].split(';') + const originalPath = process.env['PATH'].split(';') + let path = originalPath.slice() // Remove conflicting dev tools from PATH path = path.filter(e => !e.match(/\b(Chocolatey|CMake|mingw64|OpenSSL|Strawberry)\b/)) @@ -7945,6 +7946,13 @@ function setupPath(msys2, rubyPrefix) { // Add the downloaded Ruby in PATH path.unshift(`${rubyPrefix}\\bin`) + console.log("Entries removed from PATH to avoid conflicts with MSYS2 and Ruby:") + for (const entry of originalPath) { + if (!path.includes(entry)) { + console.log(entry) + } + } + const newPath = path.join(';') core.exportVariable('PATH', newPath) } diff --git a/windows.js b/windows.js index aac2dfd37..8ae031f23 100644 --- a/windows.js +++ b/windows.js @@ -62,7 +62,8 @@ async function linkMSYS2() { } export function setupPath(msys2, rubyPrefix) { - let path = process.env['PATH'].split(';') + const originalPath = process.env['PATH'].split(';') + let path = originalPath.slice() // Remove conflicting dev tools from PATH path = path.filter(e => !e.match(/\b(Chocolatey|CMake|mingw64|OpenSSL|Strawberry)\b/)) @@ -78,6 +79,13 @@ export function setupPath(msys2, rubyPrefix) { // Add the downloaded Ruby in PATH path.unshift(`${rubyPrefix}\\bin`) + console.log("Entries removed from PATH to avoid conflicts with MSYS2 and Ruby:") + for (const entry of originalPath) { + if (!path.includes(entry)) { + console.log(entry) + } + } + const newPath = path.join(';') core.exportVariable('PATH', newPath) }