hack/prepare-for-integration-tests.sh: default COLORTERM for when not set

Signed-off-by: Andrew Keesler <ankeesler1@gmail.com>
This commit is contained in:
Andrew Keesler 2020-10-14 19:58:43 -04:00
parent 84a0084703
commit 87c7e9a556
No known key found for this signature in database
GPG Key ID: 167D21E5665FE20E

View File

@ -20,7 +20,7 @@ function tilt_mode() {
function log_note() { function log_note() {
GREEN='\033[0;32m' GREEN='\033[0;32m'
NC='\033[0m' NC='\033[0m'
if [[ $COLORTERM =~ ^(truecolor|24bit)$ ]]; then if [[ ${COLORTERM:-unknown} =~ ^(truecolor|24bit)$ ]]; then
echo -e "${GREEN}$*${NC}" echo -e "${GREEN}$*${NC}"
else else
echo "$*" echo "$*"
@ -30,7 +30,7 @@ function log_note() {
function log_error() { function log_error() {
RED='\033[0;31m' RED='\033[0;31m'
NC='\033[0m' NC='\033[0m'
if [[ $COLORTERM =~ ^(truecolor|24bit)$ ]]; then if [[ ${COLORTERM:-unknown} =~ ^(truecolor|24bit)$ ]]; then
echo -e "🙁${RED} Error: $* ${NC}" echo -e "🙁${RED} Error: $* ${NC}"
else else
echo ":( Error: $*" echo ":( Error: $*"