aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils
diff options
context:
space:
mode:
authorjoshua stein2018-02-12 11:06:55 -0600
committerjoshua stein2018-02-12 14:19:25 -0600
commit7388acb86e0b9811e6badd610255954b3b3a6453 (patch)
treecbdbcc011e7b87ed25d7cc03a81d058e4965a390 /Library/Homebrew/utils
parente904983275eb17cde115f8f586a8e6502a9126d4 (diff)
downloadbrew-7388acb86e0b9811e6badd610255954b3b3a6453.tar.bz2
Tty: if HOMEBREW_NO_COLOR env var is present, disable color
bin/brew will recognize NO_COLOR variable and copy it to HOMEBREW_NO_COLOR
Diffstat (limited to 'Library/Homebrew/utils')
-rw-r--r--Library/Homebrew/utils/tty.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/utils/tty.rb b/Library/Homebrew/utils/tty.rb
index e872e6460..81d5f00d7 100644
--- a/Library/Homebrew/utils/tty.rb
+++ b/Library/Homebrew/utils/tty.rb
@@ -59,7 +59,9 @@ module Tty
end
def to_s
- return "" unless $stdout.tty?
+ if ENV["HOMEBREW_NO_COLOR"] || !$stdout.tty?
+ return ""
+ end
current_escape_sequence
ensure
reset_escape_sequence!