aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Stepanov Aleksey <blueingreen@bluig.xyz>2025-08-08 07:02:56 +0500
committerLibravatar Stepanov Aleksey <blueingreen@bluig.xyz>2025-08-08 07:02:56 +0500
commitf2f4ab207c47b9e1bce28664254e80efa64a7cfa (patch)
tree4d0a6c98545a1eb3049ce7d8d327e4c9d103ec0e
parent70e2938f3d8b464d2e811ed15578e3898b491d9f (diff)
refactor deleteProject function
-rwxr-xr-xlib/edit.sh8
1 files 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