Created
August 13, 2013 20:58
-
-
Save ankurcha/6225631 to your computer and use it in GitHub Desktop.
Groovy wrapper
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/sh | |
| GROOVY_VERSION=${$GROOVY_VERSION:-"2.1.6"} | |
| if [ -z "$@" ]; then | |
| echo "No argument specified" | |
| exit 1 | |
| fi | |
| if [ ! -f "$@" ]; then | |
| echo "$@ does not exist" | |
| exit 2 | |
| fi | |
| if [ ! -d "$HOME/groovy-$GROOVY_VERSION" ]; then | |
| echo "Installing groovy-$GROOVY_VERSION" | |
| # install groovy and set vars | |
| cd $HOME/bin | |
| wget -q "http://dist.groovy.codehaus.org/distributions/groovy-binary-$GROOVY_VERSION.zip" | |
| unzip "groovy-binary-$GROOVY_VERSION.zip" | |
| rm "groovy-binary-$GROOVY_VERSION.zip" | |
| cat > $HOME/.bashrc <<DELIM | |
| export GROOVY_HOME="/usr/local/groovy" | |
| export PATH="\$GROOVY_HOME/bin:\$PATH" | |
| DELIM | |
| else | |
| echo "Goovy $GROOVY_VERSION already installed" | |
| fi | |
| echo "Setting GROOVY_HOME" | |
| # export groovy_home and update path | |
| export GROOVY_HOME="$HOME/groovy-$GROOVY_VERSION" | |
| export PATH="$GROOVY_HOME/bin:$PATH" | |
| groovy "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment