aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/hooks
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2016-02-07 13:29:17 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2016-02-07 13:29:44 +0100
commite5ba06ff5d13b40cd840afe83ec63e38fa11c3c2 (patch)
tree125899a60cabd243657834c685ea319feb62bf37 /contrib/hooks
parente40646d30f71bde50ae1d8b6e10262d760efe5de (diff)
downloadcalcurse-e5ba06ff5d13b40cd840afe83ec63e38fa11c3c2.tar.gz
calcurse-e5ba06ff5d13b40cd840afe83ec63e38fa11c3c2.zip
calcurse-caldav: Add hook support
Introduce pre-sync and post-sync hooks which need to be located under ~/.calcurse/caldav/hooks/ and are executed before/after synchronization with a CalDAV server. Also, add an example post-sync hook and change the example post-save hook such that it does not create tiny commits during synchronization. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'contrib/hooks')
-rwxr-xr-xcontrib/hooks/post-save4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/hooks/post-save b/contrib/hooks/post-save
index d68461a..e75ce1e 100755
--- a/contrib/hooks/post-save
+++ b/contrib/hooks/post-save
@@ -4,6 +4,10 @@
# automatically commit any changes to the calcurse data files using Git.
cd "$HOME"/.calcurse/
+
+# Do not make commits when synchronizing with a CalDAV server.
+[ -f caldav/lock ] && exit
+
git add *
if ! git diff-index --quiet --cached HEAD; then
git commit -m "Automatic commit by the post-save hook"