[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [chutney/master] Don't colour warnings when outputting to a file
commit 23b5d63ebdb450745a743fb2f403a912b008f176
Author: teor <teor2345@xxxxxxxxx>
Date: Fri Feb 24 11:19:33 2017 +1100
Don't colour warnings when outputting to a file
Fixes #21548.
---
tools/warnings.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/warnings.sh b/tools/warnings.sh
index 6c2cbab..52187bd 100755
--- a/tools/warnings.sh
+++ b/tools/warnings.sh
@@ -48,9 +48,12 @@ function usage() {
exit 1
}
-NC=$(tput sgr0)
-YELLOW=$(tput setaf 3)
-GREEN=$(tput setaf 2)
+# Don't colour in log files
+if [ -t 1 ]; then
+ NC=$(tput sgr0)
+ YELLOW=$(tput setaf 3)
+ GREEN=$(tput setaf 2)
+fi
CHUTNEY="$CHUTNEY_PATH/chutney"
NAME=$(basename "$0")
DEST="$CHUTNEY_PATH/net/nodes"
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits