From f2f4ab207c47b9e1bce28664254e80efa64a7cfa Mon Sep 17 00:00:00 2001 From: Stepanov Aleksey Date: Fri, 8 Aug 2025 07:02:56 +0500 Subject: refactor deleteProject function --- lib/edit.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/edit.sh b/lib/edit.sh index 19974b1..7abe241 100755 --- a/lib/edit.sh +++ b/lib/edit.sh @@ -172,12 +172,10 @@ function deleteProject() { local idsTaskProject local nameProject - idsTaskProject=$(getIdsTask "$1") + readarray -t idsTaskProject < <(getIdsTask "$1") nameProject=$(getNameProject "$1") - if [[ "${#idsTaskProject[@]}" -eq 0 ]]; then - return - else + if [[ "${#idsTaskProject[@]}" ]]; then task rc.bulk=0 rc.confirmation=off project:"$nameProject" -COMPLETED -DELETED +current delete fi } @@ -198,7 +196,7 @@ function deleteProject() { function recreateProject() { for taskIndex in "${!taskStages[@]}"; do if [[ "$taskIndex" -eq 0 ]]; then - task add "${taskStages[$taskIndex]}" project:"$nameProject" order:$(("$taskIndex" + 2 - 1)) +current + task add "${taskStages[$taskIndex]}" project:"$projectName" order:$(("$taskIndex" + 2 - 1)) +current else task add "${taskStages[$taskIndex]}" project:"$nameProject" depends:"$uuidNewTask" order:$(("$taskIndex" + 2 - 1)) +current fi -- cgit