Skip to content

Commit 568cdbf

Browse files
committed
Revert "Add support for gems.rb/gems.locked during bundle install."
* This reverts commit 638e8ff. * Needs some fixes and review.
1 parent 638e8ff commit 568cdbf

File tree

2 files changed

+12
-36
lines changed

2 files changed

+12
-36
lines changed

dist/index.js

Lines changed: 6 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -213,26 +213,14 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine,
213213
}
214214

215215
async function bundleInstall(platform, engine, version) {
216-
if (await bundleInstallSpecific('gems.rb', 'gems.locked', platform, engine, version)) {
217-
return true
218-
}
219-
220-
if (await bundleInstallSpecific('Gemfile', 'Gemfile.lock', platform, engine, version)) {
221-
return true
222-
}
223-
224-
console.log('No Gemfile/gems.rb, skipping "bundle install" and caching')
225-
}
226-
227-
async function bundleInstallSpecific(gemsPath, lockPath, platform, engine, version) {
228-
if (!fs.existsSync(gemsPath)) {
229-
return false
216+
if (!fs.existsSync('Gemfile')) {
217+
console.log('No Gemfile, skipping "bundle install" and caching')
218+
return
230219
}
231220

232221
// config
233222
const path = 'vendor/bundle'
234-
const hasGemfileLock = fs.existsSync(lockPath)
235-
223+
const hasGemfileLock = fs.existsSync('Gemfile.lock');
236224
if (hasGemfileLock) {
237225
await exec.exec('bundle', ['config', '--local', 'deployment', 'true'])
238226
}
@@ -244,9 +232,9 @@ async function bundleInstallSpecific(gemsPath, lockPath, platform, engine, versi
244232
let key = baseKey
245233
let restoreKeys
246234
if (hasGemfileLock) {
247-
key += `-${lockPath}-${await common.hashFile(lockPath)}`
235+
key += `-Gemfile.lock-${await common.hashFile('Gemfile.lock')}`
248236
// If only Gemfile.lock we can reuse some of the cache (but it will keep old gem versions in the cache)
249-
restoreKeys = [`${baseKey}-${lockPath}-`]
237+
restoreKeys = [`${baseKey}-Gemfile.lock-`]
250238
} else {
251239
// Only exact key, to never mix native gems of different platforms or Ruby versions
252240
restoreKeys = []

0 commit comments

Comments
 (0)