Skip to content

Commit

Permalink
dev-cmd/edit: do not shadow formula with local dir
Browse files Browse the repository at this point in the history
When current directory contains dir with the same name as formula,
`brew edit <formula>` now opens the formula instead of the dir.

Fixes Homebrew#16015.
  • Loading branch information
abitrolly authored Sep 25, 2023
1 parent f1d345a commit 4eed0a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Library/Homebrew/cli/named_args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def to_paths(only: parent&.only_formula_or_cask, recurse_tap: false)
@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 path.file?(name)
path
elsif name.count("/") == 1 && !name.start_with?("./", "/")
tap = Tap.fetch(name)
Expand Down

0 comments on commit 4eed0a2

Please sign in to comment.