[IMP] Launch script: Pretty output by using few colours.

This commit is contained in:
Olivier DOSSMANN 2016-01-13 09:30:46 +01:00
parent c9b36bf736
commit 1307362b43

View File

@ -21,13 +21,24 @@ GISSMO_DOCKER_NAME="gissmo"
GISSMO_DIR="${PROJECT_DIR}/${GIT_DIR_NAME}" GISSMO_DIR="${PROJECT_DIR}/${GIT_DIR_NAME}"
DOCKERFILE="${GISSMO_DIR}/${DOCKERFILE_NAME}" DOCKERFILE="${GISSMO_DIR}/${DOCKERFILE_NAME}"
## Miscellaneous
COMMAND="$1" COMMAND="$1"
shift 1; ARGS="$@" 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 # METHODS
error_and_continue() { error_and_continue() {
echo "ERROR: $1" echo "${red}ERROR${reset}: $1"
} }
error_and_quit() { error_and_quit() {
@ -36,7 +47,7 @@ error_and_quit() {
} }
info() { info() {
echo "INFO: $1" echo "${yellow}INFO${reset}: $1"
} }
not_implemented() { not_implemented() {
@ -45,7 +56,7 @@ not_implemented() {
show_help() { show_help() {
echo "$PROGRAM [COMMAND]" 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 " - 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 " - 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" echo -e " - migrate Launch migration command: python manage.py migrate"