Created
August 3, 2016 08:50
-
-
Save henrik242/5f1d802e0e3a33f8ca63152fd5206785 to your computer and use it in GitHub Desktop.
Poor man's /usr/bin/groovy
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
#!/usr/bin/env bash | |
# poor man's /usr/bin/groovy :) | |
if test -x "$(which java)"; then | |
JAVAEXEC="$(which java)" | |
elif test -x "$JAVA_HOME/bin/java"; then | |
JAVAEXEC="$JAVA_HOME/bin/java" | |
else | |
echo "ERROR: Could not find java binary" | |
exit 1 | |
fi | |
GROOVYJAR=$(find /path/to/jars -name 'groovy-all-*.jar' -print -quit) | |
if test -z "$GROOVYJAR"; then | |
echo "ERROR: Could not find the groovy-all jar!" | |
exit 1 | |
fi | |
$JAVAEXEC \ | |
-classpath $GROOVYJAR:. \ | |
org.codehaus.groovy.tools.GroovyStarter \ | |
--main groovy.ui.GroovyMain \ | |
$@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment