From 1e11533ba9a5d038824667bd08a314e5eb332e15 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Tue, 29 Jul 2025 12:25:42 -0400 Subject: [PATCH] build(install.sh): added prompt_yes_or_no back --- install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/install.sh b/install.sh index 96744a25..98765b5c 100755 --- a/install.sh +++ b/install.sh @@ -98,6 +98,20 @@ vercomp() { return 0 } +# Prompt the user for a yes/no answer. +prompt_yes_no() { + local prompt_msg="$1" + local answer + while true; do + read -p "$(echo -e "${YELLOW}${prompt_msg}${NC}") " answer + case "$answer" in + [Yy]* ) return 0;; + [Nn]* ) return 1;; + * ) echo "Please answer yes or no.";; + esac + done +} + # Show the help message and exit. show_help() {