Merge pull request #16046 from Bo98/to_paths-only-fix

cli/named_args: don't interpret `--formula`/`--cask` args as paths
This commit is contained in:
Mike McQuaid 2023-09-27 19:20:26 +01:00 committed by GitHub
commit 67fab9ae07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)