Last active
August 29, 2015 14:08
-
-
Save xerial/5657cb4bef125ae8b261 to your computer and use it in GitHub Desktop.
Script for launching Scala REPL
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 | |
if [ -z "$PROG_HOME" ] ; then | |
## resolve links - $0 may be a link to PROG_HOME | |
PRG="$0" | |
# need this for relative symlinks | |
while [ -h "$PRG" ] ; do | |
ls=`ls -ld "$PRG"` | |
link=`expr "$ls" : '.*-> \(.*\)$'` | |
if expr "$link" : '/.*' > /dev/null; then | |
PRG="$link" | |
else | |
PRG="`dirname "$PRG"`/$link" | |
fi | |
done | |
saveddir=`pwd` | |
PROG_HOME=`dirname "$PRG"`/.. | |
# make it fully qualified | |
PROG_HOME=`cd "$PROG_HOME" && pwd` | |
cd "$saveddir" | |
fi | |
exec java -cp "${PROG_HOME}/conf:${PROG_HOME}/lib/*" -Dprog.home="${PROG_HOME}" -Dscala.usejavacp=true scala.tools.nsc.MainGenericRunner -Yrepl-sync -i "${PROG_HOME}/script/init.scala" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment