From 2ebd17bccddcbd4f7b701b67bb2a498034c16b34 Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Sat, 19 Jun 2021 08:20:22 -0500 Subject: [PATCH] Update runtime logging of Path adjustments, show additions --- common.js | 14 +++++++++++--- dist/index.js | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) 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)) }