cli/named_args: don't interpret --formula/--cask args as paths

This commit is contained in:
Bo Anderson 2023-09-27 17:56:39 +01:00
parent b4274c8e00
commit ba2ecede1a
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

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