diff --git a/dist/index.js b/dist/index.js index b16e122..3fdcc70 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1073,7 +1073,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version) function setupPath(ruby, newPathEntries) { const originalPath = process.env['PATH'].split(path.delimiter) - let cleanPath = originalPath.filter(e => !/\bruby\b/i.test(e)) + let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry)) if (cleanPath.length !== originalPath.length) { console.log("Entries removed from PATH to avoid conflicts with Ruby:") @@ -4895,9 +4895,9 @@ async function install(platform, ruby) { // we use certs and embedded MSYS2 from hostedRuby const hostedRuby = latestHostedRuby() - let toolsPaths = (version === 'mswin') ? + let toolchainPaths = (version === 'mswin') ? await setupMSWin(hostedRuby) : await setupMingw(hostedRuby, version) - const newPathEntries = [`${rubyPrefix}\\bin`, ...toolsPaths] + const newPathEntries = [`${rubyPrefix}\\bin`, ...toolchainPaths] // Install Bundler if needed if (!fs.existsSync(`${rubyPrefix}\\bin\\bundle.cmd`)) { @@ -4949,8 +4949,8 @@ async function setupMSWin(hostedRuby) { return addVCVARSEnv() } -/* Sets msvc environment for use in Actions - * allows steps to run without running vcvars*.bat, also allows using PS scripts +/* Sets MSVC environment for use in Actions + * allows steps to run without running vcvars*.bat, also for PowerShell * adds a convenience VCVARS environment variable * this assumes a single Visual Studio version being available in the windows-latest image */ function addVCVARSEnv() { @@ -4966,17 +4966,17 @@ function addVCVARSEnv() { newEnv.set(k,v) }) - let newPathEntries = null + let newPathEntries = undefined for (let [k, v] of newEnv) { if (process.env[k] !== v) { if (k === 'Path') { - newPathEntries = v.replace(process.env['Path'], '') + newPathEntries = v.replace(process.env['Path'], '').split(';') } else { core.exportVariable(k, v) } } } - return [newPathEntries] + return newPathEntries } diff --git a/index.js b/index.js index 972cc0b..fadb979 100644 --- a/index.js +++ b/index.js @@ -84,7 +84,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version) function setupPath(ruby, newPathEntries) { const originalPath = process.env['PATH'].split(path.delimiter) - let cleanPath = originalPath.filter(e => !/\bruby\b/i.test(e)) + let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry)) if (cleanPath.length !== originalPath.length) { console.log("Entries removed from PATH to avoid conflicts with Ruby:") diff --git a/windows.js b/windows.js index 23836a9..7074362 100644 --- a/windows.js +++ b/windows.js @@ -36,9 +36,9 @@ export async function install(platform, ruby) { // we use certs and embedded MSYS2 from hostedRuby const hostedRuby = latestHostedRuby() - let toolsPaths = (version === 'mswin') ? + let toolchainPaths = (version === 'mswin') ? await setupMSWin(hostedRuby) : await setupMingw(hostedRuby, version) - const newPathEntries = [`${rubyPrefix}\\bin`, ...toolsPaths] + const newPathEntries = [`${rubyPrefix}\\bin`, ...toolchainPaths] // Install Bundler if needed if (!fs.existsSync(`${rubyPrefix}\\bin\\bundle.cmd`)) { @@ -90,8 +90,8 @@ async function setupMSWin(hostedRuby) { return addVCVARSEnv() } -/* Sets msvc environment for use in Actions - * allows steps to run without running vcvars*.bat, also allows using PS scripts +/* Sets MSVC environment for use in Actions + * allows steps to run without running vcvars*.bat, also for PowerShell * adds a convenience VCVARS environment variable * this assumes a single Visual Studio version being available in the windows-latest image */ export function addVCVARSEnv() { @@ -107,15 +107,15 @@ export function addVCVARSEnv() { newEnv.set(k,v) }) - let newPathEntries = null + let newPathEntries = undefined for (let [k, v] of newEnv) { if (process.env[k] !== v) { if (k === 'Path') { - newPathEntries = v.replace(process.env['Path'], '') + newPathEntries = v.replace(process.env['Path'], '').split(';') } else { core.exportVariable(k, v) } } } - return [newPathEntries] + return newPathEntries }