-
-
Save joelso/3247046 to your computer and use it in GitHub Desktop.
script to easily switch between Playframework versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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