Merge remote-tracking branch 'origin/ci-no-color-codes' into integration_2023_w42
This commit is contained in:
@@ -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() {
|
|||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user