brew.rb: handle cask autoinstall when cask tapped.

Otherwise it would assume if `cask` was tapped it was also installed.
This commit is contained in:
Mike McQuaid 2015-12-08 10:40:47 +00:00
parent 9b030d382c
commit 8d6b6a451b

View File

@ -162,21 +162,27 @@ 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"
if cmd == "cask" && (brew_cask = Formulary.factory("brew-cask")) \
&& !brew_cask.installed?
require "cmd/install"
brew_cask = Formulary.factory("brew-cask")
Homebrew.install_formula(brew_cask)
command_installed = true
end
if command_installed
exec HOMEBREW_BREW_FILE, cmd, *ARGV
end
else
onoe "Unknown command: #{cmd}"
exit 1
end
end
rescue FormulaUnspecifiedError
abort "This command requires a formula argument"