cli/named_args: expand paths in #to_paths

This will make the output clearer for `brew edit --print-path`.
This commit is contained in:
apainintheneck 2023-09-27 23:16:20 -07:00
parent 92d2cec5fa
commit b1c47969a6

View File

@ -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?("./", "/")