Cleanup warnings

This commit is contained in:
Michael Stanclift 2020-05-22 13:31:42 -05:00
parent 312a11da4f
commit 4fb552d5ec

View File

@ -160,7 +160,6 @@ function validate_ph_folders {
# List GS Arguments # List GS Arguments
function list_gs_arguments { function list_gs_arguments {
echo -e "[ ${RED}FAILURE${NC} ] Missing Required Arguments"
echo -e "Usage: $0 [options]" echo -e "Usage: $0 [options]"
echo -e "Example: '$0 pull'" echo -e "Example: '$0 pull'"
echo -e "" echo -e ""
@ -174,26 +173,28 @@ function list_gs_arguments {
echo -e " ${YELLOW}LOGS${NC} Show recent successful jobs" echo -e " ${YELLOW}LOGS${NC} Show recent successful jobs"
echo -e "" echo -e ""
echo -e "No changes have been made to the system" echo -e "No changes have been made to the system"
exit 1 exit
} }
# SCRIPT EXECUTION ########################### # SCRIPT EXECUTION ###########################
echo -e "${CYAN}Evaluating $0 script arguments${NC}" echo -e "[ ${CYAN}STATUS${NC} ] Evaluating Script Arguments$"
case $# in case $# in
0) 0)
echo -e "[ ${RED}FAILURE${NC} ] Missing Required Arguments"
list_gs_arguments list_gs_arguments
exit
;; ;;
1) 1)
case $1 in case $1 in
pull) pull)
echo -e "${GREEN}Success${NC}: Pull Requested" echo -e "[ ${GREEN}SUCCESS${NC} ] Pull Requested"
import_gs import_gs
echo -e "${CYAN}Validating sync folder configuration${NC}" echo -e "[ ${CYAN}STATUS${NC} ] Validating Folder Configuration"
validate_gs_folders validate_gs_folders
validate_ph_folders validate_ph_folders
@ -202,10 +203,10 @@ case $# in
;; ;;
push) push)
echo -e "${GREEN}Success${NC}: Push Requested" echo -e "[ ${GREEN}SUCCESS${NC} ] Push Requested"
import_gs import_gs
echo -e "${CYAN}Validating sync folder configuration${NC}" echo -e "[ ${CYAN}STATUS${NC} ] Validating Folder Configuration"
validate_gs_folders validate_gs_folders
validate_ph_folders validate_ph_folders
@ -214,33 +215,33 @@ case $# in
;; ;;
version) version)
echo -e "${PURPLE}Info:${NC} Gravity Sync ${VERSION}" echo -e "[ ${PURPLE}INFO${NC} ] Gravity Sync ${VERSION}"
echo -e "No changes have been made to the system" echo -e "No changes have been made to the system"
exit exit
;; ;;
update) update)
echo -e "${GREEN}Success:${NC} Update Requested" echo -e "[ ${GREEN}SUCCESS${NC} ] Update Requested"
update_gs update_gs
exit exit
;; ;;
logs) logs)
echo -e "${GREEN}Success:${NC} Logs Requested" echo -e "[ ${GREEN}SUCCESS${NC} ] Logs Requested"
logs_gs logs_gs
;; ;;
*) *)
echo -e "${RED}'$1' is not a valid argument${NC}" echo -e "[ ${RED}FAILURE${NC} ] ${RED}'$1'${NC} is Invalid Arguments"
echo "Usage: $0 {pull|push}" list_gs_arguments
exit 2 exit
;; ;;
esac esac
;; ;;
*) *)
echo -e "${RED}Too many arguments provided ($#)${NC}" echo -e "[ ${RED}FAILURE${NC} ] Too Many Arguments"
echo "Usage: $0 {pull|push}" list_gs_arguments
exit 3 exit
;; ;;
esac esac