Created
November 23, 2010 15:11
-
-
Save robfletcher/711897 to your computer and use it in GitHub Desktop.
bash script to change current Grails symlink
This file contains 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/sh | |
VERSION=$1 | |
GRAILS_DIR=/opt/grails-$VERSION | |
GRAILS_SYMLINK=/opt/grails | |
if [[ ! -d $GRAILS_DIR ]]; then | |
echo "Error: $GRAILS_DIR does not exist" | |
exit 1 | |
fi | |
if [[ -e $GRAILS_SYMLINK ]]; then | |
if [[ ! -h $GRAILS_SYMLINK ]]; then | |
echo "Error: $GRAILS_SYMLINK is not a symbolic link" | |
exit 1 | |
fi | |
rm $GRAILS_SYMLINK | |
fi | |
ln -s $GRAILS_DIR $GRAILS_SYMLINK | |
echo "Now using $GRAILS_DIR for Grails" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment