From 90b410c2a95b9672467b748aee40bfffcdec36d2 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Tue, 31 Mar 2020 00:17:42 +0200 Subject: [PATCH] brew.sh: obey HOMEBREW_COLOR --- Library/Homebrew/brew.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 421129f8b5..de3d5b5e54 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -27,7 +27,7 @@ esac export HOMEBREW_COMMAND_DEPTH=$((HOMEBREW_COMMAND_DEPTH + 1)) ohai() { - if [[ -t 1 && -z "$HOMEBREW_NO_COLOR" ]] # check whether stdout is a tty. + if [[ -n "$HOMEBREW_COLOR" || (-t 1 && -z "$HOMEBREW_NO_COLOR") ]] # check whether stdout is a tty. then echo -e "\\033[34m==>\\033[0m \\033[1m$*\\033[0m" # blue arrow and bold text else @@ -36,7 +36,7 @@ ohai() { } onoe() { - if [[ -t 2 && -z "$HOMEBREW_NO_COLOR" ]] # check whether stderr is a tty. + if [[ -n "$HOMEBREW_COLOR" || (-t 2 && -z "$HOMEBREW_NO_COLOR") ]] # check whether stderr is a tty. then echo -ne "\\033[4;31mError\\033[0m: " >&2 # highlight Error with underline and red color else