Skip to content

Commit

Permalink
rlwrap changes plus fix TERM dumb check for emacs
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtharriger committed May 7, 2012
1 parent 74119cf commit 9669862
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions liverepl.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,34 @@

[ -z "$JDK_HOME" ] && JDK_HOME=/usr/lib/jvm/default-java
LIVEREPL_HOME="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
CLOJURE_JAR="$LIVEREPL_HOME/clojure.jar"

if [ ! -f "$JDK_HOME/lib/tools.jar" ]; then
echo 'Unable to find $JDK_HOME/lib/tools.jar'
echo "Please set the JDK_HOME environment variable to the location of your JDK."
exit 1
MAIN=net.djpowell.liverepl.client.Main
CLOJURE_JAR=$(find $LIVEREPL_HOME -name 'clojure-*[0-9].jar')
AGENT_JAR="$LIVEREPL_HOME/build/liverepl-agent.jar"
SERVER_JAR="$LIVEREPL_HOME/build/liverepl-server.jar"


if [ "Darwin" = "`uname -s`" ]; then
CLASSPATH="${CLASSPATH}${JAVA_HOME}/bundle/Classes/classes.jar"
elif [ ! -f "$JDK_HOME/lib/tools.jar" ]; then
echo 'Unable to find $JDK_HOME/lib/tools.jar'
echo "Please set the JDK_HOME environment variable to the location of your JDK."
exit 1
else
CLASSPATH="${CLASSPATH}${JDK_HOME}/lib/tools.jar"
fi

if [ "$TERM" != "dumb" ]; then
if which rlwrap >/dev/null ; then
echo "Found rlwrap"
breakchars="(){}[],^%$#@\"\";:''|\\"
WRAP="exec rlwrap --remember -c -b \"$breakchars\" "
fi
fi

java -cp "$LIVEREPL_HOME/liverepl-agent.jar:$JDK_HOME/lib/tools.jar" net.djpowell.liverepl.client.Main "$CLOJURE_JAR" "$LIVEREPL_HOME/liverepl-agent.jar" "$LIVEREPL_HOME/liverepl-server.jar" "$@"
CLASSPATH="$CLASSPATH:$AGENT_JAR"

${WRAP}java -cp $CLASSPATH $MAIN "$CLOJURE_JAR" "$AGENT_JAR" "$SERVER_JAR" "$@"



0 comments on commit 9669862

Please sign in to comment.