summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fish/conf.d/taskwarrior.fish18
1 files changed, 11 insertions, 7 deletions
diff --git a/fish/conf.d/taskwarrior.fish b/fish/conf.d/taskwarrior.fish
index 7ec437b..e822d60 100644
--- a/fish/conf.d/taskwarrior.fish
+++ b/fish/conf.d/taskwarrior.fish
@@ -99,15 +99,19 @@ end
function taskwarrior::export
_taskwarrior::set_import_export_tags
- set -l count (task +$TASK_EXPORT_TAG status:pending count)
+ set -l ts (date +%s)
- if test $count -eq 0
- return
- end
+ for task_status in pending completed
+ set -l count (task +$TASK_EXPORT_TAG status:$task_status count)
+
+ if test $count -eq 0
+ continue
+ end
- echo "Exporting $count tasks to $TASK_EXPORT_TAG"
- task +$TASK_EXPORT_TAG status:pending export >"$WORKTIME_DIR/tw-$TASK_EXPORT_TAG-export-$(date +%s).json"
- yes | task +$TASK_EXPORT_TAG status:pending delete
+ echo "Exporting $count $task_status tasks to $TASK_EXPORT_TAG"
+ task +$TASK_EXPORT_TAG status:$task_status export >"$WORKTIME_DIR/tw-$TASK_EXPORT_TAG-export-$ts-$task_status.json"
+ yes | task +$TASK_EXPORT_TAG status:$task_status delete
+ end
end
function taskwarrior::import