Skip to content

Commit 1eaaf34

Browse files
committed
Avoid reinstalling bundler if the required version is already installed
1 parent b1da480 commit 1eaaf34

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎bundler.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
144144
const versionParts = [...bundlerVersion.matchAll(/\d+/g)].length
145145
const bundlerVersionConstraint = versionParts >= 3 ? bundlerVersion : `~> ${bundlerVersion}.0`
146146

147-
await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint])
147+
// Use --conservative only when installing a percise version.
148+
const conservative = versionParts >= 3 ? ['--conservative'] : []
149+
150+
await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint, ...conservative])
148151

149152
return bundlerVersion
150153
}

‎dist/index.js‎

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)