From a49c54fc41a4e2063f0de42633a9600f3ef4d5f3 Mon Sep 17 00:00:00 2001 From: Pocco81 Date: Tue, 3 Aug 2021 23:17:40 -0500 Subject: [PATCH] refactor --- install.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 7ed3898c..4863cf30 100755 --- a/install.sh +++ b/install.sh @@ -6,6 +6,8 @@ ORANGE='\033[0;33m' BLUE='\033[0;34m' NC='\033[0m' # No Color +skip=0 + # https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux prompt() { case ${1} in @@ -37,7 +39,6 @@ _usage() { " } -skip=0 _skip_ahead() { amount=$1 @@ -142,5 +143,12 @@ main() { _parse_args "assert_arg" "${argvs[@]}" } +init() { + if [ $# -eq 0 ]; then + prompt -e "ERROR: This script needs at least one argument" + else + main "${@}" + fi +} -main "${@}" +init "${@}"