Fix looping
This commit is contained in:
@@ -256,7 +256,7 @@ ask_pn() {
|
|||||||
if sanitize_pn "$response"; then
|
if sanitize_pn "$response"; then
|
||||||
ADD_PROJECTS+=("$response")
|
ADD_PROJECTS+=("$response")
|
||||||
echo "$response successfully added as a project"
|
echo "$response successfully added as a project"
|
||||||
i=1 # resetting trys counter in case user wants to add more than 3 projects
|
i=0 # resetting trys counter in case user wants to add more than 3 projects
|
||||||
else
|
else
|
||||||
err "Invalid project name: $response"
|
err "Invalid project name: $response"
|
||||||
echo "Retrying ($i of $trys)"
|
echo "Retrying ($i of $trys)"
|
||||||
@@ -530,7 +530,7 @@ interactive_header() {
|
|||||||
if [[ $num -eq 0 ]]; then
|
if [[ $num -eq 0 ]]; then
|
||||||
ask_pn && PROJECTS+=("${ADD_PROJECTS[@]}")
|
ask_pn && PROJECTS+=("${ADD_PROJECTS[@]}")
|
||||||
else
|
else
|
||||||
for ((c=0; c<=1; c++)); do # safe loop that only runs once
|
for ((c=1; c<2; c++)); do # safe loop that only runs once
|
||||||
echo "Enter a comma-separated list of project numbers to analyze"
|
echo "Enter a comma-separated list of project numbers to analyze"
|
||||||
((YES)) || read -r -p "Enter 0 to add a new project or hit Enter for default project ($num): " response
|
((YES)) || read -r -p "Enter 0 to add a new project or hit Enter for default project ($num): " response
|
||||||
if [[ $response == 0 ]]; then
|
if [[ $response == 0 ]]; then
|
||||||
@@ -2209,7 +2209,7 @@ main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# (Safe) main loop
|
# (Safe) main loop
|
||||||
for ((i=0; i<=1; i++)); do
|
for ((i=1; i<2; i++)); do
|
||||||
main "$@" && i=0 # on successful run, reset the counter
|
main "$@" && i=0 # on successful run, reset the counter
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user