#!/bin/sh
# To enable this hook, make this file executable by "chmod +x post-update".
#exec git-update-server-info


URL=woodbolly.com
PROTO="/home/$USER/www/$URL/proto"
PUBLIC="/home/$USER/www/$URL/public"

export GIT_DIR="$PROTO/.git"
pushd $PROTO > /dev/null
git pull
popd > /dev/null

echo -----------------------------
echo '** Pushing changes to 'woodbolly.com
echo '** Moving current public to /tmp'
mv "$PUBLIC" "/tmp/woodbolly.compublic-`date +%m%d%Y`"
echo "** Generating new public"
jekyll "$PROTO" "$PUBLIC"

