formula: fix specified_path for aliases without core tap

This commit is contained in:
Bo Anderson 2023-12-01 17:00:15 +00:00
parent e6dfc9a94a
commit 27730f68c5
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -343,13 +343,14 @@ class Formula
# The path that was specified to find this formula.
def specified_path
default_specified_path = Pathname(T.must(alias_path)) if alias_path.present?
default_specified_path ||= @unresolved_path
alias_pathname = Pathname(T.must(alias_path)) if alias_path.present?
return alias_pathname if alias_pathname&.exist?
return @unresolved_path if @unresolved_path.exist?
return default_specified_path if default_specified_path.presence&.exist?
return local_bottle_path if local_bottle_path.presence&.exist?
default_specified_path
alias_pathname || @unresolved_path
end
# The name specified to find this formula.