From a9b52518bf44eb47f2c9dc9e7b53b0803ea546eb Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Wed, 8 Mar 2017 14:29:51 -0800 Subject: [PATCH] Shift numbers for argument identifiers, functions are called after `shift` Signed-off-by: Dan Schaper --- advanced/Scripts/piholeCheckout.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh index cabafc04..c1eacd6d 100644 --- a/advanced/Scripts/piholeCheckout.sh +++ b/advanced/Scripts/piholeCheckout.sh @@ -129,24 +129,24 @@ checkout() echo "::: done!" elif [[ "${1}" == "core" ]] ; then # Have to user chosing the branch he wants - if ! (for e in "${corebranches[@]}"; do [[ "$e" == "${3}" ]] && exit 0; done); then - echo "::: Requested branch \"${3}\" is not available!" + if ! (for e in "${corebranches[@]}"; do [[ "$e" == "${2}" ]] && exit 0; done); then + echo "::: Requested branch \"${2}\" is not available!" echo "::: Available branches for core are:" for e in "${corebranches[@]}"; do echo "::: $e"; done exit 1 fi - checkout_pull_branch "${PI_HOLE_FILES_DIR}" "${3}" + checkout_pull_branch "${PI_HOLE_FILES_DIR}" "${2}" elif [[ "${1}" == "web" ]] ; then # Have to user chosing the branch he wants - if ! (for e in "${webbranches[@]}"; do [[ "$e" == "${3}" ]] && exit 0; done); then - echo "::: Requested branch \"${3}\" is not available!" + if ! (for e in "${webbranches[@]}"; do [[ "$e" == "${2}" ]] && exit 0; done); then + echo "::: Requested branch \"${2}\" is not available!" echo "::: Available branches for web are:" for e in "${webbranches[@]}"; do echo "::: $e"; done exit 1 fi checkout_pull_branch "${webInterfaceDir}" "${3}" else - echo "::: Requested option \"${2}\" is not available!" + echo "::: Requested option \"${1}\" is not available!" exit 1 fi