Merge pull request #16051 from apainintheneck/expand-paths-in-to-paths

cli/named_args: expand paths in #to_paths
This commit is contained in:
Mike McQuaid 2023-09-28 12:41:32 +01:00 committed by GitHub
commit eadbe0f184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,7 +229,7 @@ module Homebrew
@to_paths ||= {} @to_paths ||= {}
@to_paths[only] ||= Homebrew.with_no_api_env_if_needed(@without_api) do @to_paths[only] ||= Homebrew.with_no_api_env_if_needed(@without_api) do
downcased_unique_named.flat_map do |name| downcased_unique_named.flat_map do |name|
path = Pathname(name) path = Pathname(name).expand_path
if only.nil? && File.exist?(name) if only.nil? && File.exist?(name)
path path
elsif name.count("/") == 1 && !name.start_with?("./", "/") elsif name.count("/") == 1 && !name.start_with?("./", "/")