Merge pull request #11730 from Rylan12/fix-latest-version-installed

formula: fix `latest_version_installed?` for `HOMEBREW_JSON_CORE`
This commit is contained in:
Rylan Polster 2021-07-16 12:52:56 -04:00 committed by GitHub
commit dbcd764968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -520,8 +520,8 @@ class Formula
# exists and is not empty.
# @private
def latest_version_installed?
latest_prefix = if ENV["HOMEBREW_JSON_CORE"].present?
prefix BottleAPI.latest_pkg_version(name)
latest_prefix = if ENV["HOMEBREW_JSON_CORE"].present? && (latest_pkg_version = BottleAPI.latest_pkg_version(name))
prefix latest_pkg_version
else
latest_installed_prefix
end