Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
const gem = path.join(rubyPrefix, 'bin', 'gem')

const versionParts = [...bundlerVersion.matchAll(/\d+/g)].length
const bundlerVersionConstraint = versionParts >= 3 ? bundlerVersion : `~> ${bundlerVersion}.0`
// Use --conservative to avoid reinstalling the exact same version if already installed.
const options = versionParts >= 3 ? ['-v', bundlerVersion, '--conservative'] : ['-v', `~> ${bundlerVersion}.0`]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only use --conservative for a precise version requirement, so that ~> will always check for updates.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but could you add a comment?
--conservative is usually used for to avoid upgrading what doesn't need to be and this is a bit of a special case: avoid reinstalling the same version to avoid concurrency issues as described in #951.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.


await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint])
await exec.exec(gem, ['install', 'bundler', ...options])

return bundlerVersion
}
Expand Down
5 changes: 3 additions & 2 deletions dist/index.js

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

Loading