Allow forcing colored output.

This commit is contained in:
Markus Reiter 2018-08-02 07:20:40 +02:00
parent 3a99e64646
commit 9db17ab5bc
2 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,8 @@ module Homebrew
end
HOMEBREW_LIBRARY_PATH.cd do
ENV.delete("HOMEBREW_COLOR")
ENV.delete("HOMEBREW_NO_COLOR")
ENV.delete("HOMEBREW_VERBOSE")
ENV.delete("VERBOSE")
ENV.delete("HOMEBREW_CASK_OPTS")

View File

@ -61,7 +61,7 @@ module Tty
end
def to_s
if ENV["HOMEBREW_NO_COLOR"] || !$stdout.tty?
if !ENV["HOMEBREW_COLOR"] && (ENV["HOMEBREW_NO_COLOR"] || !$stdout.tty?)
return ""
end
current_escape_sequence