From: Charles McGarvey Date: Fri, 15 Nov 2019 04:29:03 +0000 (-0700) Subject: also honor COLOR_DEPTH environment variable X-Git-Tag: v0.44~1 X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fgit-codeowners;a=commitdiff_plain;h=6428b239d2454b5272c52cc1bb9ca1eadfc7cdd9 also honor COLOR_DEPTH environment variable --- 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}$/) {