Small cleanups

This commit is contained in:
Benoit Daloze
2020-03-07 14:30:46 +01:00
parent 1ad4d1b6db
commit 67ca12cfaa
3 changed files with 16 additions and 16 deletions
Generated Vendored
+8 -8
View File
@@ -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
}
+1 -1
View File
@@ -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
View File
@@ -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
}