Merge pull request #19604 from Homebrew/tweak_brew_bundle_version_file

bundle/brew_installer: strip revision number from version file.
This commit is contained in:
Mike McQuaid 2025-03-26 01:46:49 +00:00 committed by GitHub
commit c68682a33c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,11 +61,12 @@ module Homebrew
if result && @version_file.present?
# Use the version from the environment if it hasn't changed.
# Strip the revision number because it's not part of the non-Homebrew version.
version = if !changed? && (env_version = Bundle.formula_versions_from_env[@name])
env_version
PkgVersion.parse(env_version).version
else
Formula[@full_name].version.to_s
end
Formula[@full_name].version
end.to_s
version_path = Pathname.new(@version_file)
version_path.write("#{version}\n")