Commit 191ab1a9 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/ci-no-color-codes' into integration_2023_w42

parents 0caa6523 bab4ad2d
...@@ -54,16 +54,17 @@ fi ...@@ -54,16 +54,17 @@ fi
############################### ###############################
## echo and family ## echo and family
############################### ###############################
black='\E[30m' # only emit color if connected to a terminal, and if it supports colors
red='\E[31m' if [ -t 1 ]; then
green='\E[32m' num_colors=$(tput colors)
yellow='\E[33m' if [ -n "$num_colors" ] && [ "$num_colors" -ge 8 ]; then
blue='\E[1;34m' red='\E[31m'
magenta='\E[35m' green='\E[32m'
cyan='\E[36m' yellow='\E[33m'
white='\E[37m' blue='\E[1;34m'
reset_color='\E[00m' reset_color='\E[00m'
COLORIZE=1 fi
fi
cecho() { cecho() {
# Color-echo # Color-echo
...@@ -72,8 +73,7 @@ cecho() { ...@@ -72,8 +73,7 @@ cecho() {
local default_msg="No Message." local default_msg="No Message."
message=${1:-$default_msg} message=${1:-$default_msg}
color=${2:-$green} color=${2:-$green}
[ "$COLORIZE" = "1" ] && message="$color$message$reset_color" echo -e "$color$message$reset_color"
echo -e "$message"
return return
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment