Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 27 lines (21 sloc) 556 Bytes
#!/bin/bash
# Exit if any of the commands fails.
set -e
cd $HOME/repos/mirror
lockfile=.`basename $0`.lock
if ( set -o noclobber; echo "$$" > "$lockfile") 2> /dev/null;
then
trap 'stat=$?; rm -f "$lockfile"; exit $stat' EXIT
# Pull down new changes from svn
find . -mindepth 1 -maxdepth 2 -type d -name \*.git-svn | while read dir
do
pushd $dir
git svn fetch -q
popd
done
# Push changes to github
~/bin/github-sync
else
echo "Failed to acquire lockfile: $lockfile"
echo "Held by PID: $(cat $lockfile)"
fi