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:
parent
1f8af42fee
commit
78dcafaa10
2
bin/brew
2
bin/brew
@ -77,7 +77,7 @@ begin
|
|||||||
elsif require? `/usr/bin/which brew-#{cmd}.rb`
|
elsif require? `/usr/bin/which brew-#{cmd}.rb`
|
||||||
exit 0
|
exit 0
|
||||||
elsif require? HOMEBREW_REPOSITORY/"Library/Homebrew/cmd"/cmd
|
elsif require? HOMEBREW_REPOSITORY/"Library/Homebrew/cmd"/cmd
|
||||||
Homebrew.send cmd.to_s.gsub('-', '_')
|
Homebrew.send cmd.to_s.gsub('-', '_').downcase
|
||||||
else
|
else
|
||||||
onoe "Unknown command: #{cmd}"
|
onoe "Unknown command: #{cmd}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user