mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Print entries removed from PATH on Windows
This commit is contained in:
+9
-1
@@ -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
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user