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.
This commit is contained in:
Xu Cheng 2015-09-08 16:06:39 +08:00
parent 67c3f8ff27
commit e3299bb7a3

View File

@ -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")