Reorder functions

This commit is contained in:
Benoit Daloze
2020-03-07 14:23:16 +01:00
parent 2e093de9b3
commit 1ad4d1b6db
2 changed files with 32 additions and 32 deletions
Generated Vendored
+16 -16
View File
@@ -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()
+16 -16
View File
@@ -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()