From a0b7bc54e009093af7a815efa175a93c17817940 Mon Sep 17 00:00:00 2001 From: Andrew Stevenson Date: Sat, 23 Jul 2022 09:29:42 +0000 Subject: [PATCH] Enable colour only when writing to a tty The escape codes can confuse other scripts and things in pipes --- usr/local/share/bastille/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/share/bastille/common.sh b/usr/local/share/bastille/common.sh index 9ecac747..de557ef9 100644 --- a/usr/local/share/bastille/common.sh +++ b/usr/local/share/bastille/common.sh @@ -38,7 +38,7 @@ enable_color() { } # If "NO_COLOR" environment variable is present, disable output colors. -if [ -z "${NO_COLOR}" ]; then +if [ -z "${NO_COLOR}" -a -t 1 ]; then enable_color fi