From e3299bb7a39c2eb5505496c4dca05092ca378cc1 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Tue, 8 Sep 2015 16:06:39 +0800 Subject: [PATCH] quiet_system: don't print cmd even when verbose mode It's kinda annoying that quiet_system wasn't really quiet. This commit fixes that. --- Library/Homebrew/utils.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 1fa0814198..2b496565cb 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -133,8 +133,7 @@ def interactive_shell(f = nil) end module Homebrew - def self.system(cmd, *args) - puts "#{cmd} #{args*" "}" if ARGV.verbose? + def self._system(cmd, *args) pid = fork do yield if block_given? args.collect!(&:to_s) @@ -145,6 +144,11 @@ module Homebrew $?.success? end + def self.system(cmd, *args) + puts "#{cmd} #{args*" "}" if ARGV.verbose? + _system(cmd, *args) + end + def self.git_head HOMEBREW_REPOSITORY.cd { `git rev-parse --verify -q HEAD 2>/dev/null`.chuzzle } end @@ -213,7 +217,7 @@ end # prints no output def quiet_system(cmd, *args) - Homebrew.system(cmd, *args) do + Homebrew._system(cmd, *args) do # Redirect output streams to `/dev/null` instead of closing as some programs # will fail to execute if they can't write to an open stream. $stdout.reopen("/dev/null")