Permalink
Browse files

Added colored error messages.

  • Loading branch information...
jimbru committed Apr 28, 2012
1 parent 5220b8e commit 27e1dd1c7dbab377696f34534358e5d3a21d747a
Showing with 15 additions and 3 deletions.
  1. +15 −3 srctool
View
18 srctool
@@ -20,7 +20,7 @@ action_install() {
echo yes | $SCRIPT_PATH/hldsupdatetool.bin > /dev/null
if [[ $? != 0 ]]
then
- echo "ERROR: Hldsupdatetool.bin exited abnormally. Exiting..."
+ print_error "Hldsupdatetool.bin exited abnormally."
exit 1
fi
@@ -38,11 +38,23 @@ action_install() {
done
if [[ $INDEX == $RETRY ]]
then
- echo "ERROR: Steam failed after $RETRY retries. Exiting..."
+ print_error "Steam failed after $RETRY retries."
exit 1
fi
- echo "[ DONE ]"
+ print_done
+}
+
+print_done() {
+ GREEN='\e[0;32m'
+ ENDCOLOR='\e[0m'
+ echo -e "[ ${GREEN}DONE${ENDCOLOR} ]"
+}
+
+print_error() {
+ RED='\e[0;31m'
+ ENDCOLOR='\e[0m'
+ echo -e "[ ${RED}ERROR${ENDCOLOR} ] $1"
}
print_usage() {

0 comments on commit 27e1dd1

Please sign in to comment.