Skip to content

Commit

Permalink
Merge pull request #18705 from cocateh/cmd_casesens
Browse files Browse the repository at this point in the history
Downcase internal commands
  • Loading branch information
MikeMcQuaid authored Nov 4, 2024
2 parents 4d0deeb + 9fd678c commit 614678f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Library/Homebrew/brew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@
Utils::Analytics.report_command_run(command_instance)
command_instance.run
else
Homebrew.public_send Commands.method_name(cmd)
begin
Homebrew.public_send Commands.method_name(cmd)
rescue NoMethodError => e
case_error = "undefined method `#{cmd.downcase}' for module Homebrew"
odie "Unknown command: brew #{cmd}" if e.message == case_error

raise
end
end
elsif (path = Commands.external_ruby_cmd_path(cmd))
Homebrew.running_command = cmd
Expand Down

0 comments on commit 614678f

Please sign in to comment.