Print entries removed from PATH on Windows

This commit is contained in:
Benoit Daloze
2020-02-09 23:37:52 +01:00
parent 71f024b642
commit e15ecc8aaa
2 changed files with 18 additions and 2 deletions
Generated Vendored
+9 -1
View File
@@ -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)
}
+9 -1
View File
@@ -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)
}