taskwarrior/scripts/hooks/on-exit
Wilhelm Schuermann df209b9b8b TW-1587: Further improve example on-exit hook
- Initial patch was not quite right.  on-exit _does_ receive added and
  modified tasks on STDIN, but is not allowed to return JSON.
2015-03-31 07:25:23 +02:00

20 lines
358 B
Bash
Executable file

#!/bin/sh
# The on-exit event is triggered once, after all processing is complete.
# This hooks script has no effect on processing.
# Output:
# - Optional feedback/error.
n=0
while read modified_task
do
n=$(($n + 1))
done
echo "on-exit: Counted $n added/modified tasks."
# Status:
# - 0: Non-JSON is feedback.
# - non-0: Non-JSON is error.
exit 0