Skip to content

Instantly share code, notes, and snippets.

@kevintpeng
Created July 10, 2018 16:23
Show Gist options
  • Save kevintpeng/299593b02a18267dbc98fab87941ee5a to your computer and use it in GitHub Desktop.
Save kevintpeng/299593b02a18267dbc98fab87941ee5a to your computer and use it in GitHub Desktop.
#!/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
date >> ~/.task/sync_hook.log
task sync >> ~/.task/sync_hook.log 2>&1 &
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment