Merge pull request #18705 from cocateh/cmd_casesens

Downcase internal commands
This commit is contained in:
Mike McQuaid 2024-11-04 09:02:02 +00:00 committed by GitHub
commit 614678fa29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,7 +93,14 @@ begin
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