From 7f0f12e61bd68c951f1c522433fe2ea7f602220b Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Sun, 27 Dec 2020 11:11:20 -0500 Subject: [PATCH] Add sanity check for function argument --- lug-helper.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index b9c37af..6f935d8 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -759,10 +759,15 @@ install_runner() { } 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 - case "$runner_contributor" in + case "$1" in "snatella") latest_url="$snatella_url" runner_versions=($(curl -s "$latest_url" | grep "browser_download_url" | awk '{print $2}' | xargs basename -as .tgz))