Skip to content

Instantly share code, notes, and snippets.

@joelso
Forked from bverbeken/usePlay.sh
Created August 3, 2012 12:15
Show Gist options
  • Save joelso/3247046 to your computer and use it in GitHub Desktop.
Save joelso/3247046 to your computer and use it in GitHub Desktop.
script to easily switch between Playframework versions
#!/bin/bash
BASE_PATH="$HOME/playframework"
changeVersion () {
ln -nsf $1 $BASE_PATH/play;
}
usage() {
echo 'Use this script to quickly switch between Play!Framework versions.'
echo 'Usage: usePlay version'
echo 'Possible versions are:'
echo ' 1 - 1.2.4 (latest stable)'
echo ' 2 - 2.0.2'
}
if [[ $# != 1 ]]
then
echo 'Error: please specify the version you wich to use'
echo ' '
usage
else
case $1 in
"1") export PLAY_HOME="$BASE_PATH/play-1.2.4"; version="1.2.4" ;;
"2") export PLAY_HOME="$BASE_PATH/play-2.0.2"; version="2.0.2" ;;
esac
if [[ $version ]]
then
changeVersion $PLAY_HOME
echo "Ok. Using Play! $version now"
else
echo 'Warning: unsupported version: ' $1
echo
usage
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment