diff --git a/desktop/res/go.sh b/desktop/res/go.sh index a1fdb2e..492c339 100755 --- a/desktop/res/go.sh +++ b/desktop/res/go.sh @@ -2,16 +2,26 @@ set -e +function cecho { + case $1 in + red) tput setaf 1 ;; + green) tput setaf 2 ;; + yellow) tput setaf 3 ;; + esac + echo -e "$2" + tput sgr0 +} + function do_make { make "$1" \ - && (tput setaf 2 ; echo "make $1 good" ; tput sgr0 ) \ - || (tput setaf 1 ; tput blink ; echo "MAKE $1 BAD" ; tput sgr0 ; return 1) + && (cecho green "make $1 good") \ + || (tput blink ; cecho red "MAKE $1 BAD" ; return 1) } function verify { diff "orig/DESKTOP2_$1" "$1.built" \ - && (tput setaf 2 ; echo "diff $1 good" ; tput sgr0 ) \ - || (tput setaf 1 ; tput blink ; echo -e "DIFF $1 BAD" ; tput sgr0 ; return 1) + && (cecho green "diff $1 good" ) \ + || (tput blink ; cecho red "DIFF $1 BAD" ; return 1) } function stats {