From 43c132a95765993427a6bced305c9f793ff9501f Mon Sep 17 00:00:00 2001 From: Martin Scheidt Date: Fri, 11 Mar 2022 10:55:21 +0100 Subject: [PATCH] refactored log() function --- build.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index c67f612..34fec6e 100755 --- a/build.sh +++ b/build.sh @@ -133,15 +133,13 @@ log() { if [ "$2" = "-n" ]; then NO_LINE_BREAK=1 fi - if [ $1 = 1 ]; then - COLOR=${RED} - fi - if [ $1 = 2 ]; then - COLOR=${GREEN} - fi - if [ $1 = 4 ]; then - COLOR=${YELLOW} - fi + + case $1 in + 1) COLOR=${RED};; + 2) COLOR=${GREEN};; + 4) COLOR=${YELLOW};; + esac + if [ $VERBOSITY -ge $1 ]; then shift if [ $NO_LINE_BREAK = 0 ]; then