Created
July 10, 2018 16:23
-
-
Save kevintpeng/299593b02a18267dbc98fab87941ee5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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