From 27730f68c5e1671d62ddb76501c6a73c31c63a6e Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 1 Dec 2023 17:00:15 +0000 Subject: [PATCH] formula: fix specified_path for aliases without core tap --- Library/Homebrew/formula.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index f0fc5d6c6030d..b3712bd6a744c 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -343,13 +343,14 @@ def full_installed_alias_name # 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.