#!/bin/sh set -e tmp=$(mktemp) cleanup(){ rm -f $tmp rm -rf notmyidea } trap "cleanup" 1 2 3 13 15 svn checkout https://github.com/getpelican/pelican/trunk/pelican/themes/notmyidea \ | tee $tmp revision=$(grep "^Checked out revision" $tmp | sed -e 's/.* \([0-9]\+\).*/\1/') echo $revision git switch upstream || git checkout -b upstream cp -a notmyidea/* . git add static templates if [ -n "$(git diff --cached)" ] ; then git commit -m "Update for new upstream version (revision $revision)" fi git switch main cleanup