aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2015-12-08 10:40:47 +0000
committerMike McQuaid2015-12-08 10:41:27 +0000
commit8d6b6a451b854a4958ecd3812794f93afc083578 (patch)
tree8b3c616110bc10767c383da2baf77ee550164a66 /Library
parent9b030d382c69c9f7d3595bcaab2811a2e24623f8 (diff)
downloadbrew-8d6b6a451b854a4958ecd3812794f93afc083578.tar.bz2
brew.rb: handle cask autoinstall when cask tapped.
Otherwise it would assume if `cask` was tapped it was also installed.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/brew.rb22
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