From 1307362b43a693f4d37175bf2ac40d8f1edbce37 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Wed, 13 Jan 2016 09:30:46 +0100 Subject: [PATCH] [IMP] Launch script: Pretty output by using few colours. --- launch.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/launch.sh b/launch.sh index 941945a..ed375e5 100755 --- a/launch.sh +++ b/launch.sh @@ -21,13 +21,24 @@ GISSMO_DOCKER_NAME="gissmo" GISSMO_DIR="${PROJECT_DIR}/${GIT_DIR_NAME}" DOCKERFILE="${GISSMO_DIR}/${DOCKERFILE_NAME}" +## Miscellaneous COMMAND="$1" shift 1; ARGS="$@" +red=`tput setaf 9` +green=`tput setaf 2` +yellow=`tput setaf 3` +blue=`tput setaf 4` +violet=`tput setaf 5` +cyan=`tput setaf 6` +white=`tput setaf 7` +reset=`tput sgr0` # No Color + + # METHODS error_and_continue() { - echo "ERROR: $1" + echo "${red}ERROR${reset}: $1" } error_and_quit() { @@ -36,7 +47,7 @@ error_and_quit() { } info() { - echo "INFO: $1" + echo "${yellow}INFO${reset}: $1" } not_implemented() { @@ -45,7 +56,7 @@ not_implemented() { show_help() { echo "$PROGRAM [COMMAND]" - echo -e " Where COMMAND is one of:" + echo -e " Where ${green}COMMAND${reset} is one of:" echo -e " - create Create postgreSQL database volume and postgreSQL Docker container" echo -e " - init Create project directory as python virtual environment, fetch git repository and install Python dependancies" echo -e " - migrate Launch migration command: python manage.py migrate"