summaryrefslogtreecommitdiff
path: root/contrib/caldav/hooks/post-sync
blob: 1ac028ca98d65cf391273dd4c690b2797be0fd64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
#
# This is an example hook. If the calcurse data directory contains a Git
# repository, it automatically makes a commit whenever synchronizing with a
# CalDAV server.
#
# In order to install this hook, copy this file to ~/.calcurse/caldav/hooks/.

cd "$HOME"/.calcurse/

# If the data directory is under version control, create a Git commit.
if [ -d .git -a -x "$(which git)" ]; then
	git add apts conf keys todo
	if ! git diff-index --quiet --cached HEAD; then
		git commit -m "Automatic commit by the post-sync hook"
	fi
fi