diff --git a/common.js b/common.js index abdf6ef..12b3fb2 100644 --- a/common.js +++ b/common.js @@ -154,17 +154,17 @@ export function setupPath(newPathEntries) { const originalPath = process.env[envPath].split(path.delimiter) let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry)) + core.startGroup(`Modifying ${envPath}`) + // First remove the conflicting path entries if (cleanPath.length !== originalPath.length) { - core.startGroup(`Cleaning ${envPath}`) - console.log(`Entries removed from ${envPath} to avoid conflicts with Ruby:`) + console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`) for (const entry of originalPath) { if (!cleanPath.includes(entry)) { console.log(` ${entry}`) } } core.exportVariable(envPath, cleanPath.join(path.delimiter)) - core.endGroup() } // Then add new path entries using core.addPath() @@ -176,5 +176,13 @@ export function setupPath(newPathEntries) { } else { 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)) } diff --git a/dist/index.js b/dist/index.js index d19d4ec..11b628a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -395,17 +395,17 @@ function setupPath(newPathEntries) { const originalPath = process.env[envPath].split(path.delimiter) let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry)) + core.startGroup(`Modifying ${envPath}`) + // First remove the conflicting path entries if (cleanPath.length !== originalPath.length) { - core.startGroup(`Cleaning ${envPath}`) - console.log(`Entries removed from ${envPath} to avoid conflicts with Ruby:`) + console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`) for (const entry of originalPath) { if (!cleanPath.includes(entry)) { console.log(` ${entry}`) } } core.exportVariable(envPath, cleanPath.join(path.delimiter)) - core.endGroup() } // Then add new path entries using core.addPath() @@ -417,6 +417,14 @@ function setupPath(newPathEntries) { } else { 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)) }