From 6428b239d2454b5272c52cc1bb9ca1eadfc7cdd9 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Thu, 14 Nov 2019 21:29:03 -0700 Subject: [PATCH] also honor COLOR_DEPTH environment variable --- lib/App/Codeowners/Formatter/String.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/App/Codeowners/Formatter/String.pm b/lib/App/Codeowners/Formatter/String.pm index 6421783..ecc0808 100644 --- a/lib/App/Codeowners/Formatter/String.pm +++ b/lib/App/Codeowners/Formatter/String.pm @@ -61,7 +61,7 @@ sub _colored { my $text = shift; my $rgb = shift or return $text; - return $text if $ENV{NO_COLOR}; + return $text if $ENV{NO_COLOR} || (defined $ENV{COLOR_DEPTH} && !$ENV{COLOR_DEPTH}); $rgb =~ s/^(.)(.)(.)$/$1$1$2$2$3$3/; if ($rgb !~ m/^[0-9a-fA-F]{6}$/) { -- 2.43.0