aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Reiter2017-07-27 19:33:01 +0200
committerGitHub2017-07-27 19:33:01 +0200
commita49d99a2d6a22f9db1540cb546ac2d7be2fb5703 (patch)
treeb8f8987b3a256a21639716267d0e71a016a5d494
parent867590b648674a1cda1cad68ba50d9f861b12bfe (diff)
parentd8288eeb3a962c7647a9240caf13cc174e98d5d2 (diff)
downloadbrew-a49d99a2d6a22f9db1540cb546ac2d7be2fb5703.tar.bz2
Merge pull request #2949 from reitermarkus/caskroom-messages
Don’t output Caskroom creation messages on non-TTY.
-rw-r--r--Library/Homebrew/cask/lib/hbc/caskroom.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/caskroom.rb b/Library/Homebrew/cask/lib/hbc/caskroom.rb
index 7f4aab0a9..b5c947f4b 100644
--- a/Library/Homebrew/cask/lib/hbc/caskroom.rb
+++ b/Library/Homebrew/cask/lib/hbc/caskroom.rb
@@ -5,10 +5,10 @@ module Hbc
def ensure_caskroom_exists
return if Hbc.caskroom.exist?
- ohai "Creating Caskroom at #{Hbc.caskroom}"
+ ohai "Creating Caskroom at #{Hbc.caskroom}" if $stdout.tty?
sudo = !Hbc.caskroom.parent.writable?
- ohai "We'll set permissions properly so we won't need sudo in the future" if sudo
+ ohai "We'll set permissions properly so we won't need sudo in the future" if $stdout.tty? && sudo
SystemCommand.run("/bin/mkdir", args: ["-p", Hbc.caskroom], sudo: sudo)
SystemCommand.run("/bin/chmod", args: ["g+rwx", Hbc.caskroom], sudo: sudo)