#!/bin/sh
dir=`pwd`
cd ~/Projects/KoLmafia/kolmafia/
echo "Downloading updates..."
oldrev=`svn info | grep Revision | sed 's/[^0-9]//g'`
svn update -q
newrev=`svn info | grep Revision | sed 's/[^0-9]//g'`
if [ $oldrev -lt $newrev ] ; then
echo "Update downloaded, building..."
ant -q
rm /Applications/KoL/*.jar
prog=`ls dist`
mv dist/$prog /Applications/KoL/
echo "Build complete. Accessing log..."
svn log -r$oldrev:$newrev
else
echo "No updates available."
fi
echo "Launching..."
cd /Applications/KoL/
prog=`ls *.jar`
open /Applications/KoL/$prog
cd $dir
echo "Done."