Commit 08eaf186 authored by Rishikesh Nair's avatar Rishikesh Nair Committed by Brad Davidson

Rename `RAW_OUTPUT` -> `NO_COLOR`

Also, if NO_COLOR is empty, output will be colored, otherwise not colored. Signed-off-by: 's avatarRishikesh Nair <alienware505@gmail.com> (cherry picked from commit ce0765c9) Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com>
parent ff81da4f
......@@ -21,9 +21,6 @@ binDir=$(dirname "$0")
configFormat=gz
isError=0
# RAW_OUTPUT=1 disables colored outputs
RAW_OUTPUT=${RAW_OUTPUT:-0}
if [ $# -gt 0 ]; then
CONFIG="$1"
fi
......@@ -58,6 +55,10 @@ is_set_as_module() {
}
color() {
if [[ -n "$NO_COLOR" ]]; then
return
fi
codes=
if [ "$1" = 'bold' ]; then
codes=1
......@@ -84,11 +85,6 @@ color() {
printf '\033['"$codes"'m'
}
wrap_color() {
if [ $RAW_OUTPUT -eq 1 ]; then
echo -n "$1"
return
fi
text="$1"
shift
color "$@"
......
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