Improvements based on code review

This commit is contained in:
Rylan Polster 2021-07-14 10:19:29 -04:00
parent c5df900936
commit 3e01e02a02
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64
2 changed files with 3 additions and 5 deletions

View File

@ -74,6 +74,7 @@ module BottleAPI
existing_formula = begin existing_formula = begin
Formulary.factory dep_hash["name"] Formulary.factory dep_hash["name"]
rescue FormulaUnavailableError rescue FormulaUnavailableError
# The formula might not exist if it's not installed and homebrew/core isn't tapped
nil nil
end end

View File

@ -244,11 +244,8 @@ module Homebrew
specs = [] specs = []
if (stable = f.stable) if (stable = f.stable)
latest_version = if ENV["HOMEBREW_JSON_CORE"].present? latest_version = BottleAPI.latest_pkg_version(f.name).version if ENV["HOMEBREW_JSON_CORE"].present?
BottleAPI.latest_pkg_version(f.name).version || stable.version latest_version ||= stable.version
else
stable.version
end
s = "stable #{latest_version}" s = "stable #{latest_version}"
s += " (bottled)" if stable.bottled? && f.pour_bottle? s += " (bottled)" if stable.bottled? && f.pour_bottle?