aboutsummaryrefslogblamecommitdiffstats
path: root/contrib/caldav/hooks/post-sync
blob: 372d260832edc2031de9094f8a3093b45cdb738e (plain) (tree)
1
2
3
4
5
6
7
8
9

         



                                                                           


                                                                               


                     





                                                                      
  
#!/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
# $XDG_CONFIG_HOME/calcurse/caldav/hooks/ (~/.config/calcurse/caldav/hooks/) or
# ~/.calcurse/caldav/hooks/ if using ~/.calcurse.

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