mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8621f0b86 | ||
|
|
bd6859cc58 |
@@ -360,24 +360,23 @@ export function setupPath(newPathEntries) {
|
|||||||
const originalPath = process.env[envPath].split(path.delimiter)
|
const originalPath = process.env[envPath].split(path.delimiter)
|
||||||
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
|
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
|
||||||
|
|
||||||
core.startGroup(`Modifying ${envPath}`)
|
core.group(`Modifying ${envPath}`, async () => {
|
||||||
|
// First remove the conflicting path entries
|
||||||
// First remove the conflicting path entries
|
if (cleanPath.length !== originalPath.length) {
|
||||||
if (cleanPath.length !== originalPath.length) {
|
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`)
|
||||||
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`)
|
for (const entry of originalPath) {
|
||||||
for (const entry of originalPath) {
|
if (!cleanPath.includes(entry)) {
|
||||||
if (!cleanPath.includes(entry)) {
|
console.log(` ${entry}`)
|
||||||
console.log(` ${entry}`)
|
}
|
||||||
}
|
}
|
||||||
|
core.exportVariable(envPath, cleanPath.join(path.delimiter))
|
||||||
}
|
}
|
||||||
core.exportVariable(envPath, cleanPath.join(path.delimiter))
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`Entries added to ${envPath} to use selected Ruby:`)
|
console.log(`Entries added to ${envPath} to use selected Ruby:`)
|
||||||
for (const entry of newPathEntries) {
|
for (const entry of newPathEntries) {
|
||||||
console.log(` ${entry}`)
|
console.log(` ${entry}`)
|
||||||
}
|
}
|
||||||
core.endGroup()
|
})
|
||||||
|
|
||||||
core.addPath(newPathEntries.join(path.delimiter))
|
core.addPath(newPathEntries.join(path.delimiter))
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-15
@@ -677,24 +677,23 @@ function setupPath(newPathEntries) {
|
|||||||
const originalPath = process.env[envPath].split(path.delimiter)
|
const originalPath = process.env[envPath].split(path.delimiter)
|
||||||
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
|
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
|
||||||
|
|
||||||
core.startGroup(`Modifying ${envPath}`)
|
core.group(`Modifying ${envPath}`, async () => {
|
||||||
|
// First remove the conflicting path entries
|
||||||
// First remove the conflicting path entries
|
if (cleanPath.length !== originalPath.length) {
|
||||||
if (cleanPath.length !== originalPath.length) {
|
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`)
|
||||||
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`)
|
for (const entry of originalPath) {
|
||||||
for (const entry of originalPath) {
|
if (!cleanPath.includes(entry)) {
|
||||||
if (!cleanPath.includes(entry)) {
|
console.log(` ${entry}`)
|
||||||
console.log(` ${entry}`)
|
}
|
||||||
}
|
}
|
||||||
|
core.exportVariable(envPath, cleanPath.join(path.delimiter))
|
||||||
}
|
}
|
||||||
core.exportVariable(envPath, cleanPath.join(path.delimiter))
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`Entries added to ${envPath} to use selected Ruby:`)
|
console.log(`Entries added to ${envPath} to use selected Ruby:`)
|
||||||
for (const entry of newPathEntries) {
|
for (const entry of newPathEntries) {
|
||||||
console.log(` ${entry}`)
|
console.log(` ${entry}`)
|
||||||
}
|
}
|
||||||
core.endGroup()
|
})
|
||||||
|
|
||||||
core.addPath(newPathEntries.join(path.delimiter))
|
core.addPath(newPathEntries.join(path.delimiter))
|
||||||
}
|
}
|
||||||
@@ -85351,6 +85350,9 @@ async function setupRuby(options = {}) {
|
|||||||
if (inputs['bundler-cache'] === 'true') {
|
if (inputs['bundler-cache'] === 'true') {
|
||||||
await common.time('bundle install', async () =>
|
await common.time('bundle install', async () =>
|
||||||
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
||||||
|
|
||||||
|
await core.group(`Print lockfile`, async () =>
|
||||||
|
await exec.exec('cat', [lockFile]))
|
||||||
}
|
}
|
||||||
|
|
||||||
core.setOutput('ruby-prefix', rubyPrefix)
|
core.setOutput('ruby-prefix', rubyPrefix)
|
||||||
|
|||||||
@@ -99,6 +99,9 @@ export async function setupRuby(options = {}) {
|
|||||||
if (inputs['bundler-cache'] === 'true') {
|
if (inputs['bundler-cache'] === 'true') {
|
||||||
await common.time('bundle install', async () =>
|
await common.time('bundle install', async () =>
|
||||||
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
||||||
|
|
||||||
|
await core.group(`Print lockfile`, async () =>
|
||||||
|
await exec.exec('cat', [lockFile]))
|
||||||
}
|
}
|
||||||
|
|
||||||
core.setOutput('ruby-prefix', rubyPrefix)
|
core.setOutput('ruby-prefix', rubyPrefix)
|
||||||
|
|||||||
Reference in New Issue
Block a user