Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added colored error messages.

  • Loading branch information...
commit 27e1dd1c7dbab377696f34534358e5d3a21d747a 1 parent 5220b8e
@jimbru authored
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() {
Please sign in to comment.
Something went wrong with that request. Please try again.