mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Small cleanups
This commit is contained in:
+8
-8
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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:")
|
||||
|
||||
+7
-7
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user