We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34397ac commit 7fe72efCopy full SHA for 7fe72ef
setup.sh
@@ -14,13 +14,18 @@ execute_command() {
14
15
prompt_yes_no() {
16
echo -e "\n\033[1;34m? $1\033[0m"
17
- read -p " $2 [Y/n]: " $3
18
- eval "$3=\${$3:-y}" # Set default to 'y' if input is empty
19
-}
20
-
21
-prompt_input() {
22
- echo -e "\n\033[1;34m? $1\033[0m"
23
- read -p " $2: " $3
+ while true; do
+ if ! read -r -p " $2 [Y/n]: " response; then
+ # Handle EOF (Ctrl+D)
+ echo # Print a newline for better formatting
+ exit 1 # Return with a non-zero status to indicate cancellation
+ fi
+ case $response in
24
+ [Yy]* | '') eval "$3='y'"; return 0 ;;
25
+ [Nn]*) eval "$3='n'"; return 0 ;;
26
+ *) echo " Please answer yes (y) or no (n)." ;;
27
+ esac
28
+ done
29
}
30
31
exit_gracefully() {
0 commit comments