taskwarrior_hooks/on-exit-sync.sh

20 lines
356 B
Bash
Raw Normal View History

2023-01-26 13:34:13 -05:00
#!/bin/sh
# This hooks script syncs task warrior to the configured task server.
# The on-exit event is triggered once, after all processing is complete.
# Make sure hooks are enabled
# Count the number of tasks modified
n=0
while read modified_task
do
n=$(($n + 1))
done
if (($n > 0)); then
task sync >> ~/.config/task/sync_hook.log
fi
exit 0