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 7cf3542 commit d25f81bCopy full SHA for d25f81b
setup
@@ -22,13 +22,24 @@ read userid
22
printf "Bot Token: "
23
read_secret token
24
25
+
26
+get_input(){
27
+ while true; do
28
+ printf "Is this information correct (y/n)? "
29
+ read yn
30
+ case $yn in
31
+ [Yy]* ) return 1;;
32
+ [Nn]* ) return 0;;
33
+ * ) echo "Incorrect option (y/n)? "; echo;
34
+ esac
35
+ done
36
+}
37
38
#confirm before ending
-while true; do
- printf "Is this information correct (y/n)? "
- read yn
- case $yn in
- [Yy]* ) saveinfo "$userid" "$token"; git checkout main; . ./sync break;;
- [Nn]* ) break;;
- * ) echo "Please answer yes or no."; echo;;
- esac
-done
39
+get_input
40
+if [[ $? == 1 ]];
41
+then
42
+ saveinfo "$userid" "$token"; git checkout main; . ./sync
43
+else
44
+ exit
45
+fi
0 commit comments