Last active
January 4, 2016 02:39
-
-
Save Androguide/8556766 to your computer and use it in GitHub Desktop.
Bash boilerplate for coloured scripts and checking for passed arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CYAN="\\033[1;36m" | |
GREEN="\\033[1;32m" | |
YELLOW="\\E[33;44m" | |
RED="\\033[1;31m" | |
RESET="\\e[0m" | |
MODE='blah' | |
if [ -z "$1" ] | |
then | |
echo -n -e "\n${RED}*** NO ARGUMENTS SPECIFIED! ***${RESET}\n\n" | |
echo -n -e "${CYAN}Please input desired runmode for the build ${YELLOW}(test / prod)${RESET}${CYAN} : ${RESET}" | |
read runmode | |
MODE=$runmode | |
else | |
MODE=$1 | |
fi | |
echo -n -e "\n${CYAN}Building `basename "$PWD"` in ${YELLOW}${MODE}${RESET}${CYAN} mode...${RESET}\n" | |
RUNMODE=$MODE make build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment