You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
470 B
Bash
21 lines
470 B
Bash
verbose () {
|
|
echo "${color_green}$1${color_normal}"
|
|
}
|
|
error () {
|
|
echo "${color_red}$1${color_normal}"
|
|
}
|
|
warning () {
|
|
echo "${color_yellow}$1${color_normal}"
|
|
}
|
|
# check for color support
|
|
if test -t 1; then
|
|
# see if it supports colors...
|
|
ncolors=$(tput colors)
|
|
if test -n "$ncolors" && test $ncolors -ge 8; then
|
|
color_normal="$(tput sgr0)"
|
|
color_red="$(tput setaf 1)"
|
|
color_green="$(tput setaf 2)"
|
|
color_yellow="$(tput setaf 3)"
|
|
fi
|
|
fi
|