1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 23:08:07 +00:00

Shift numbers for argument identifiers, functions are called after shift

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper 2017-03-08 14:29:51 -08:00
parent 87da40068c
commit a9b52518bf
No known key found for this signature in database
GPG Key ID: 572E999E385B7BFC

View File

@ -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