Permalink
Browse files

modify 'repl' so it could be invoked from any directory

this should close #91, but adapted for lein2, and don't use `readlink`
  • Loading branch information...
1 parent a9fbc31 commit c5ad697e48e15d8dacbb034e6f1d8d678246a4da @alexott alexott committed Nov 23, 2012
Showing with 16 additions and 1 deletion.
  1. +16 −1 script/repl
View
@@ -1,3 +1,18 @@
#!/bin/sh
-java -Xmx1G -cp "src:test:data:.:incanter.jar" jline.ConsoleRunner clojure.main -i script/run.clj -r
+TOP_DIR=`dirname $0`/..
+
+JAR_FOUND=0
+
+CP="$TOP_DIR/src:$TOP_DIR/test:$TOP_DIR/data:."
+for f in $TOP_DIR/target/incanter-*-standalone.jar; do
+ CP="$CP:$f"
+ JAR_FOUND=1
+done
+
+if [ $JAR_FOUND -eq 0 ] ; then
+ echo "run 'lein uberjar in the top-level Incanter directory first"
+ exit 1
+fi
+
+java -Xmx1G -cp "$CP" jline.ConsoleRunner clojure.main -i "$TOP_DIR/script/run.clj" -r

0 comments on commit c5ad697

Please sign in to comment.