From 617e9d3d8e5533b1b1c5006401f2edc93cab0138 Mon Sep 17 00:00:00 2001 From: Stepanov Aleksey Date: Fri, 8 Aug 2025 07:03:11 +0500 Subject: refactor recreateProject --- lib/edit.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/edit.sh b/lib/edit.sh index 7abe241..b753416 100755 --- a/lib/edit.sh +++ b/lib/edit.sh @@ -194,11 +194,16 @@ function deleteProject() { # - edit_project.sh #****** function recreateProject() { + local projectName + projectName="$1" + + readarray -t taskStages < <(grep -v "^#" <"$TMP_TSKW_EDIT") + for taskIndex in "${!taskStages[@]}"; do if [[ "$taskIndex" -eq 0 ]]; then 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 + task add "${taskStages[$taskIndex]}" project:"$projectName" depends:"$uuidNewTask" order:$(("$taskIndex" + 2 - 1)) +current fi local uuidNewTask -- cgit