From fabf2515e6b5531555983e2641f2acdf622b0e50 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 27 Jan 2022 20:07:26 +0100 Subject: [PATCH] Allow bundler: none + bundle-cache: true to use the Bundler shipped with that Ruby + the cache --- dist/index.js | 15 ++++++++------- index.js | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index 33ffdcf..8ca2d66 100644 --- a/dist/index.js +++ b/dist/index.js @@ -59590,16 +59590,17 @@ async function setupRuby(options = {}) { await inputs['afterSetupPathHook']({ platform, rubyPrefix, engine, version }) } + const [gemfile, lockFile] = bundler.detectGemfiles() + let bundlerVersion = "unknown" + if (inputs['bundler'] !== 'none') { - const [gemfile, lockFile] = bundler.detectGemfiles() - - const bundlerVersion = await common.measure('Installing Bundler', async () => + 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) diff --git a/index.js b/index.js index b41f574..73184cb 100644 --- a/index.js +++ b/index.js @@ -78,16 +78,17 @@ export async function setupRuby(options = {}) { await inputs['afterSetupPathHook']({ platform, rubyPrefix, engine, version }) } + const [gemfile, lockFile] = bundler.detectGemfiles() + let bundlerVersion = "unknown" + if (inputs['bundler'] !== 'none') { - const [gemfile, lockFile] = bundler.detectGemfiles() - - const bundlerVersion = await common.measure('Installing Bundler', async () => + 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)