brew: downcase arg before sending to Homebrew

Fixes a case where brew would find commands with wrongly-capitalized
user input on case-insensitive systems, then error out with a confusing
message when an invalid method was sent to Homebrew. e.g.:

> brew Update
Error: undefined method `Update' for Homebrew:Module
This commit is contained in:
Misty De Meo 2012-08-22 19:55:27 -05:00
parent 1f8af42fee
commit 78dcafaa10

View File

@ -77,7 +77,7 @@ begin
elsif require? `/usr/bin/which brew-#{cmd}.rb`
exit 0
elsif require? HOMEBREW_REPOSITORY/"Library/Homebrew/cmd"/cmd
Homebrew.send cmd.to_s.gsub('-', '_')
Homebrew.send cmd.to_s.gsub('-', '_').downcase
else
onoe "Unknown command: #{cmd}"
exit 1