Merge pull request #16280 from Bo98/specified_path-alias-fix

formula: fix specified_path for aliases without core tap
This commit is contained in:
Mike McQuaid 2023-12-01 17:23:44 +00:00 committed by GitHub
commit ee5f337a82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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.