Skip to content

Instantly share code, notes, and snippets.

@robfletcher
Created November 23, 2010 15:11
Show Gist options
  • Save robfletcher/711897 to your computer and use it in GitHub Desktop.
Save robfletcher/711897 to your computer and use it in GitHub Desktop.
bash script to change current Grails symlink
#! /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