mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
clickhouse-test: enable color hiliting only when stdout is a tty [#METR-11873].
This commit is contained in:
parent
4c7226627c
commit
247d7074e9
@ -7,12 +7,19 @@
|
||||
QUERIES_DIR="./queries"
|
||||
CLIENT_PROGRAM="clickhouse-client -n"
|
||||
|
||||
|
||||
COLOR_RESET="\033[0m"
|
||||
COLOR_WHITE="\033[1;37m"
|
||||
COLOR_FAIL="\033[1;31m"
|
||||
COLOR_UNKNOWN="\033[1;30m"
|
||||
COLOR_OK="\033[1;32m"
|
||||
if [ -t 1 ]; then # stdout - терминал.
|
||||
COLOR_RESET="\033[0m"
|
||||
COLOR_WHITE="\033[1;37m"
|
||||
COLOR_FAIL="\033[1;31m"
|
||||
COLOR_UNKNOWN="\033[1;30m"
|
||||
COLOR_OK="\033[1;32m"
|
||||
else
|
||||
COLOR_RESET=""
|
||||
COLOR_WHITE=""
|
||||
COLOR_FAIL=""
|
||||
COLOR_UNKNOWN=""
|
||||
COLOR_OK=""
|
||||
fi
|
||||
|
||||
MSG_FAIL="${COLOR_WHITE}[ ${COLOR_FAIL}FAIL${COLOR_WHITE} ]${COLOR_RESET}"
|
||||
MSG_UNKNOWN="${COLOR_WHITE}[ ${COLOR_UNKNOWN}UNKNOWN${COLOR_WHITE} ]${COLOR_RESET}"
|
||||
|
Loading…
Reference in New Issue
Block a user