config/functions: fix custom colors

This commit is contained in:
mglae 2018-11-27 19:38:10 +01:00
parent ad0531121b
commit f085f0494b

View File

@ -69,10 +69,14 @@ print_color() {
# "standard" color determined by an indirect name (CLR_ERROR etc.) # "standard" color determined by an indirect name (CLR_ERROR etc.)
# #
# If ${!clr_name} doesn't exist then assume it's a standard color. # If ${!clr_name} doesn't exist then assume it's a standard color.
# If ${!clr_name} does exist then check it's not a custom color mapping.
# Custom color mappings can be configured in options files.
# #
clr_actual="${!clr_name}" clr_actual="${!clr_name}"
if [ -z "${clr_actual}" ]; then if [ -n "${clr_actual}" ]; then
clr_actual="${!clr_actual}"
else
case "${clr_name}" in case "${clr_name}" in
CLR_ERROR) clr_actual="${boldred}";; CLR_ERROR) clr_actual="${boldred}";;
CLR_WARNING) clr_actual="${boldred}";; CLR_WARNING) clr_actual="${boldred}";;