소스 검색

Don't colour warnings when outputting to a file

Fixes #21548.
teor 7 년 전
부모
커밋
23b5d63ebd
1개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 6 3
      tools/warnings.sh

+ 6 - 3
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"