From b1c47969a607bc65dcec5c98c461612759bc6aa1 Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Wed, 27 Sep 2023 23:16:20 -0700 Subject: [PATCH] cli/named_args: expand paths in #to_paths This will make the output clearer for `brew edit --print-path`. --- Library/Homebrew/cli/named_args.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cli/named_args.rb b/Library/Homebrew/cli/named_args.rb index e4b9e115aa..bfa013001b 100644 --- a/Library/Homebrew/cli/named_args.rb +++ b/Library/Homebrew/cli/named_args.rb @@ -229,7 +229,7 @@ module Homebrew @to_paths ||= {} @to_paths[only] ||= Homebrew.with_no_api_env_if_needed(@without_api) do downcased_unique_named.flat_map do |name| - path = Pathname(name) + path = Pathname(name).expand_path if only.nil? && File.exist?(name) path elsif name.count("/") == 1 && !name.start_with?("./", "/")