diff options
| author | 2025-08-08 07:03:11 +0500 | |
|---|---|---|
| committer | 2025-08-08 07:03:11 +0500 | |
| commit | 617e9d3d8e5533b1b1c5006401f2edc93cab0138 (patch) | |
| tree | 561d5f256fc365363840bd999af4d61be58330c1 | |
| parent | f2f4ab207c47b9e1bce28664254e80efa64a7cfa (diff) | |
refactor recreateProject
| -rwxr-xr-x | lib/edit.sh | 7 |
1 files changed, 6 insertions, 1 deletions
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 |
