Minimalistic Grails wrapper

Checks for the version in application.properties or uses the highest version (adjust BASE)

#!/bin/sh
BASE=~/apps
version=`ls -d "$BASE"/grails-* | tail -n1 | perl -ne 'print "$1" if (/-([0-9\.]+)$/)'`
if test -f "./application.properties"; then
      version=`cat ./application.properties | perl -ne 'print "$1" if (/app.grails.version=([0-9\.]+)$/)'`
fi
"$BASE"/grails-"$version"/bin/grails "$*"