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
Formulary.factory dep_hash["name"]
rescue FormulaUnavailableError
# The formula might not exist if it's not installed and homebrew/core isn't tapped
nil
end

View File

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