aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/install.rb
diff options
context:
space:
mode:
authorMike McQuaid2014-11-28 15:02:42 +0000
committerMike McQuaid2014-11-30 17:59:02 +0000
commit52cda8fd8040cbc9588ae64243af924f9fd15be4 (patch)
tree4f8fe9f4f5c6a40e7e61f857e29c557ed8a48508 /Library/Homebrew/cmd/install.rb
parent264886cfc9cf0b2058827fb5b70b2731aed2b59f (diff)
downloadbrew-52cda8fd8040cbc9588ae64243af924f9fd15be4.tar.bz2
Allow searching/installing Homebrew Casks.
People want to install things like GIMP using Homebrew so let's make it easier for them to find a decent installation method. Closes Homebrew/homebrew#34496. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd/install.rb')
-rw-r--r--Library/Homebrew/cmd/install.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index eb93d380b..c2789a40e 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -19,7 +19,8 @@ module Homebrew
msg = blacklisted? name
raise "No available formula for #{name}\n#{msg}" if msg
end
- if not File.exist? name and name =~ HOMEBREW_TAP_FORMULA_REGEX then
+ if !File.exist?(name) && (name =~ HOMEBREW_TAP_FORMULA_REGEX \
+ || name =~ HOMEBREW_CASK_TAP_FORMULA_REGEX)
install_tap $1, $2
end
end unless ARGV.force?
@@ -27,6 +28,17 @@ module Homebrew
begin
formulae = []
+ if ARGV.casks.any?
+ brew_cask = Formulary.factory("brew-cask")
+ install_formula(brew_cask) unless brew_cask.installed?
+
+ ARGV.casks.each do |c|
+ cmd = "brew", "cask", "install", c
+ ohai cmd.join " "
+ system *cmd
+ end
+ end
+
ARGV.formulae.each do |f|
# Building head-only without --HEAD is an error
if not ARGV.build_head? and f.stable.nil?