woensdag 18 juni 2008

example post commit hook

Sample script for a conditional post-commit hook in bash. This post-commit hook updates a local copy (www directory) to the latest revision when files are changed within a certain directory.

#!/bin/bash
umask 0002

REPOS=$1
REV=$2
MATCH=`/usr/bin/svnlook -r $REV dirs-changed $REPOS | /bin/grep -c "just a string"`

if [ $MATCH -gt 0 ];then
/usr/bin/svn update /var/www/projects/mysite
fi

Geen opmerkingen: