Add sanity check for function argument

This commit is contained in:
the-sane 2020-12-27 11:11:20 -05:00 committed by GitHub
parent da8c63fdcf
commit 7f0f12e61b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -759,10 +759,15 @@ install_runner() {
} }
choose_runner_version() { choose_runner_version() {
runner_contributor="$1" # This function expects the name of the runner contributor to be passed in as an argument
if [ -z "$1" ]; then
echo -e "\nScript error: The choose runner function expects an argument. Aborting."
read -n 1 -s -p "Press any key..."
exit 0
fi
# set download urls # set download urls
case "$runner_contributor" in case "$1" in
"snatella") "snatella")
latest_url="$snatella_url" latest_url="$snatella_url"
runner_versions=($(curl -s "$latest_url" | grep "browser_download_url" | awk '{print $2}' | xargs basename -as .tgz)) runner_versions=($(curl -s "$latest_url" | grep "browser_download_url" | awk '{print $2}' | xargs basename -as .tgz))