Fix looping

This commit is contained in:
2024-08-04 17:50:26 -04:00
parent 544a03442c
commit 3ce87f4df5

View File

@@ -256,7 +256,7 @@ ask_pn() {
if sanitize_pn "$response"; then
ADD_PROJECTS+=("$response")
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
err "Invalid project name: $response"
echo "Retrying ($i of $trys)"
@@ -530,7 +530,7 @@ interactive_header() {
if [[ $num -eq 0 ]]; then
ask_pn && PROJECTS+=("${ADD_PROJECTS[@]}")
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"
((YES)) || read -r -p "Enter 0 to add a new project or hit Enter for default project ($num): " response
if [[ $response == 0 ]]; then
@@ -2209,7 +2209,7 @@ main() {
}
# (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
done