Skip to content

Commit

Permalink
Allow bundler: none + bundle-cache: true to use the Bundler shipped w…
Browse files Browse the repository at this point in the history
…ith that Ruby + the cache
  • Loading branch information
eregon committed Jan 27, 2022
1 parent 51c0d59 commit fabf251
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
15 changes: 8 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,17 @@ export async function setupRuby(options = {}) {
await inputs['afterSetupPathHook']({ platform, rubyPrefix, engine, version })
}

if (inputs['bundler'] !== 'none') {
const [gemfile, lockFile] = bundler.detectGemfiles()
const [gemfile, lockFile] = bundler.detectGemfiles()
let bundlerVersion = "unknown"

const bundlerVersion = await common.measure('Installing Bundler', async () =>
if (inputs['bundler'] !== 'none') {
bundlerVersion = await common.measure('Installing Bundler', async () =>
bundler.installBundler(inputs['bundler'], lockFile, platform, rubyPrefix, engine, version))
}

if (inputs['bundler-cache'] === 'true') {
await common.measure('bundle install', async () =>
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
}
if (inputs['bundler-cache'] === 'true') {
await common.measure('bundle install', async () =>
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
}

core.setOutput('ruby-prefix', rubyPrefix)
Expand Down

0 comments on commit fabf251

Please sign in to comment.