From e5ba06ff5d13b40cd840afe83ec63e38fa11c3c2 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 7 Feb 2016 13:29:17 +0100 Subject: 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 --- contrib/caldav/hooks/post-sync | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 contrib/caldav/hooks/post-sync (limited to 'contrib/caldav/hooks/post-sync') diff --git a/contrib/caldav/hooks/post-sync b/contrib/caldav/hooks/post-sync new file mode 100755 index 0000000..94b6ed3 --- /dev/null +++ b/contrib/caldav/hooks/post-sync @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Copy this file into ~/.calcurse/caldav/hooks/ and mark it executable to +# automatically commit changes after syncing using Git. + +cd "$HOME"/.calcurse/ + +git add * +if ! git diff-index --quiet --cached HEAD; then + git commit -m "Automatic commit by the post-sync hook" +fi + -- cgit v1.2.3-54-g00ecf