formula: fix latest_version_installed? for HOMEBREW_JSON_CORE

This commit is contained in:
Rylan Polster 2021-07-16 12:14:15 -04:00
parent 9de68d7dce
commit 672f6dc3d7
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64

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