From 1ad4d1b6db5e933ae16760529d00e40951613fd7 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 7 Mar 2020 14:23:16 +0100 Subject: [PATCH] Reorder functions --- dist/index.js | 32 ++++++++++++++++---------------- index.js | 32 ++++++++++++++++---------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dist/index.js b/dist/index.js index fdba3ce..b16e122 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1071,6 +1071,22 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version) return engine + '-' + version } +function setupPath(ruby, newPathEntries) { + const originalPath = process.env['PATH'].split(path.delimiter) + let cleanPath = originalPath.filter(e => !/\bruby\b/i.test(e)) + + if (cleanPath.length !== originalPath.length) { + console.log("Entries removed from PATH to avoid conflicts with Ruby:") + for (const entry of originalPath) { + if (!cleanPath.includes(entry)) { + console.log(` ${entry}`) + } + } + } + + core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter)) +} + function getVirtualEnvironmentName() { const platform = os.platform() if (platform === 'linux') { @@ -1094,22 +1110,6 @@ function findUbuntuVersion() { } } -function setupPath(ruby, newPathEntries) { - const originalPath = process.env['PATH'].split(path.delimiter) - let cleanPath = originalPath.filter(e => !/\bruby\b/i.test(e)) - - if (cleanPath.length !== originalPath.length) { - console.log("Entries removed from PATH to avoid conflicts with Ruby:") - for (const entry of originalPath) { - if (!cleanPath.includes(entry)) { - console.log(` ${entry}`) - } - } - } - - core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter)) -} - run() diff --git a/index.js b/index.js index 18859e5..972cc0b 100644 --- a/index.js +++ b/index.js @@ -82,6 +82,22 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version) return engine + '-' + version } +function setupPath(ruby, newPathEntries) { + const originalPath = process.env['PATH'].split(path.delimiter) + let cleanPath = originalPath.filter(e => !/\bruby\b/i.test(e)) + + if (cleanPath.length !== originalPath.length) { + console.log("Entries removed from PATH to avoid conflicts with Ruby:") + for (const entry of originalPath) { + if (!cleanPath.includes(entry)) { + console.log(` ${entry}`) + } + } + } + + core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter)) +} + function getVirtualEnvironmentName() { const platform = os.platform() if (platform === 'linux') { @@ -105,20 +121,4 @@ function findUbuntuVersion() { } } -function setupPath(ruby, newPathEntries) { - const originalPath = process.env['PATH'].split(path.delimiter) - let cleanPath = originalPath.filter(e => !/\bruby\b/i.test(e)) - - if (cleanPath.length !== originalPath.length) { - console.log("Entries removed from PATH to avoid conflicts with Ruby:") - for (const entry of originalPath) { - if (!cleanPath.includes(entry)) { - console.log(` ${entry}`) - } - } - } - - core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter)) -} - run()