diff options
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/brew.rb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Library/brew.rb b/Library/brew.rb index 043a86821..69a0b68e5 100755 --- a/Library/brew.rb +++ b/Library/brew.rb @@ -162,20 +162,26 @@ begin Tap.fetch("Homebrew", "services") end + command_installed = false + if possible_tap && !possible_tap.installed? possible_tap.install + command_installed = true + end - if cmd == "cask" - require "cmd/install" - brew_cask = Formulary.factory("brew-cask") - Homebrew.install_formula(brew_cask) - end + if cmd == "cask" && (brew_cask = Formulary.factory("brew-cask")) \ + && !brew_cask.installed? + require "cmd/install" + Homebrew.install_formula(brew_cask) + command_installed = true + end + if command_installed exec HOMEBREW_BREW_FILE, cmd, *ARGV + else + onoe "Unknown command: #{cmd}" + exit 1 end - - onoe "Unknown command: #{cmd}" - exit 1 end rescue FormulaUnspecifiedError |
