Update runtime logging of Path adjustments, show additions
This commit is contained in:
@@ -154,17 +154,17 @@ export function setupPath(newPathEntries) {
|
|||||||
const originalPath = process.env[envPath].split(path.delimiter)
|
const originalPath = process.env[envPath].split(path.delimiter)
|
||||||
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
|
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
|
||||||
|
|
||||||
|
core.startGroup(`Modifying ${envPath}`)
|
||||||
|
|
||||||
// First remove the conflicting path entries
|
// First remove the conflicting path entries
|
||||||
if (cleanPath.length !== originalPath.length) {
|
if (cleanPath.length !== originalPath.length) {
|
||||||
core.startGroup(`Cleaning ${envPath}`)
|
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`)
|
||||||
console.log(`Entries removed from ${envPath} to avoid conflicts with Ruby:`)
|
|
||||||
for (const entry of originalPath) {
|
for (const entry of originalPath) {
|
||||||
if (!cleanPath.includes(entry)) {
|
if (!cleanPath.includes(entry)) {
|
||||||
console.log(` ${entry}`)
|
console.log(` ${entry}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.exportVariable(envPath, cleanPath.join(path.delimiter))
|
core.exportVariable(envPath, cleanPath.join(path.delimiter))
|
||||||
core.endGroup()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then add new path entries using core.addPath()
|
// Then add new path entries using core.addPath()
|
||||||
@@ -176,5 +176,13 @@ export function setupPath(newPathEntries) {
|
|||||||
} else {
|
} else {
|
||||||
newPath = newPathEntries
|
newPath = newPathEntries
|
||||||
}
|
}
|
||||||
|
console.log(`Entries added to ${envPath} to use selected Ruby:`)
|
||||||
|
for (const entry of newPath) {
|
||||||
|
if (!cleanPath.includes(entry)) {
|
||||||
|
console.log(` ${entry}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
core.endGroup()
|
||||||
|
|
||||||
core.addPath(newPath.join(path.delimiter))
|
core.addPath(newPath.join(path.delimiter))
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-3
@@ -395,17 +395,17 @@ function setupPath(newPathEntries) {
|
|||||||
const originalPath = process.env[envPath].split(path.delimiter)
|
const originalPath = process.env[envPath].split(path.delimiter)
|
||||||
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
|
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
|
||||||
|
|
||||||
|
core.startGroup(`Modifying ${envPath}`)
|
||||||
|
|
||||||
// First remove the conflicting path entries
|
// First remove the conflicting path entries
|
||||||
if (cleanPath.length !== originalPath.length) {
|
if (cleanPath.length !== originalPath.length) {
|
||||||
core.startGroup(`Cleaning ${envPath}`)
|
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`)
|
||||||
console.log(`Entries removed from ${envPath} to avoid conflicts with Ruby:`)
|
|
||||||
for (const entry of originalPath) {
|
for (const entry of originalPath) {
|
||||||
if (!cleanPath.includes(entry)) {
|
if (!cleanPath.includes(entry)) {
|
||||||
console.log(` ${entry}`)
|
console.log(` ${entry}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.exportVariable(envPath, cleanPath.join(path.delimiter))
|
core.exportVariable(envPath, cleanPath.join(path.delimiter))
|
||||||
core.endGroup()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then add new path entries using core.addPath()
|
// Then add new path entries using core.addPath()
|
||||||
@@ -417,6 +417,14 @@ function setupPath(newPathEntries) {
|
|||||||
} else {
|
} else {
|
||||||
newPath = newPathEntries
|
newPath = newPathEntries
|
||||||
}
|
}
|
||||||
|
console.log(`Entries added to ${envPath} to use selected Ruby:`)
|
||||||
|
for (const entry of newPath) {
|
||||||
|
if (!cleanPath.includes(entry)) {
|
||||||
|
console.log(` ${entry}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
core.endGroup()
|
||||||
|
|
||||||
core.addPath(newPath.join(path.delimiter))
|
core.addPath(newPath.join(path.delimiter))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user