From 24b81ffa26aff8d7525a34eb84c38c0b57c32014 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 7 Sep 2020 21:34:21 -0400 Subject: [PATCH] Use bulletproof vulcan logic, not dumb human logic --- lug-helper.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lug-helper.sh b/lug-helper.sh index 8df7756..74cc918 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -231,13 +231,14 @@ menu() { fi done - # If no match was found, the user entered an invalid option - if [ "$matched" == "false" ]; then + # Check if we're done looping the menu + if [ "$matched" == "true" ]; then + # Match was found and actioned, so exit the menu + break + else + # If no match was found, the user entered an invalid option echo -e "\nInvalid selection." continue - else - # Match was found and actioned, so exit the menu - break fi done fi