aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2016-02-25 21:09:50 +0800
committerXu Cheng2016-02-26 18:42:36 +0800
commit43c6061bc95d8e21803b227181f716e6926e28f4 (patch)
treeb1e3e81a7caef392ff7e4f0c3f9bdf8b472fbb0d /Library
parentbbe4191c617ee4fe9322a46281a87cf5810e22c7 (diff)
downloadbrew-43c6061bc95d8e21803b227181f716e6926e28f4.tar.bz2
Tap#install: support quiet option
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/tap.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index b1bc9ab0b..8519a3c6d 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -140,17 +140,21 @@ class Tap
# @param [Hash] options
# @option options [String] :clone_targe If passed, it will be used as the clone remote.
# @option options [Boolean] :full_clone If set as true, full clone will be used.
+ # @option options [Boolean] :quiet If set, suppress all output.
def install(options = {})
require "descriptions"
raise TapAlreadyTappedError, name if installed?
clear_cache
+ quiet = options.fetch(:quiet, false)
+
# ensure git is installed
Utils.ensure_git_installed!
- ohai "Tapping #{name}"
+ ohai "Tapping #{name}" unless quiet
remote = options[:clone_target] || "https://github.com/#{user}/homebrew-#{repo}"
args = %W[clone #{remote} #{path}]
args << "--depth=1" unless options.fetch(:full_clone, false)
+ args << "-q" if quiet
begin
safe_system "git", *args
@@ -165,10 +169,10 @@ class Tap
link_manpages
formula_count = formula_files.size
- puts "Tapped #{formula_count} formula#{plural(formula_count, "e")} (#{path.abv})"
+ puts "Tapped #{formula_count} formula#{plural(formula_count, "e")} (#{path.abv})" unless quiet
Descriptions.cache_formulae(formula_names)
- if !options[:clone_target] && private?
+ if !options[:clone_target] && private? && !quiet
puts <<-EOS.undent
It looks like you tapped a private repository. To avoid entering your
credentials each time you update, you can use git HTTP credential