Marty Oehme
c578a1bebc
Let taskwarrior automatically sync any changed tasks whenever a process is completed. Will sync 'asynchronously' (start the job as a terminal background process) and show the sync message after it is done.
16 lines
396 B
Bash
Executable file
16 lines
396 B
Bash
Executable file
#!/usr/bin/env 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 -r REPLY; do
|
|
n=$((n + 1))
|
|
done
|
|
|
|
if [ $n -gt 0 ]; then
|
|
SAVELOC="${XDG_DATA_HOME}/task"
|
|
task sync >>"${SAVELOC:-~/.task}/sync_hook.log" &
|
|
fi
|