Created
November 18, 2012 03:42
-
-
Save aiba/4103370 to your computer and use it in GitHub Desktop.
Fast lein repl using drip
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/bash -e | |
if [ ! -f ./project.clj ]; then | |
echo "Run from a lein project directory." | |
exit 1 | |
fi | |
mkdir -p ./.fastrepl/ | |
if command -v md5 >/dev/null 2>&1; then | |
MD5=`md5 -q project.clj` | |
elif command -v md5sum >/dev/null 2>&1; then | |
MD5=`md5sum project.clj | cut -d' ' -f1` | |
else | |
echo "Requires md5 or md5sum command. Aborting." | |
exit 1 | |
fi | |
CPFILE="./.fastrepl/classpath-$MD5" | |
if [ ! -f $CPFILE ]; then | |
echo "Generating classpath (happens once per change to project.clj)." | |
lein deps | |
lein classpath > $CPFILE | |
echo "Generated $CPFILE" | |
fi | |
breakchars="(){}[],^%$#@\"\";:''|\\" | |
rlwrap --remember --always-readline -b "$breakchars" \ | |
drip -client -noverify -XX:+TieredCompilation \ | |
-cp `cat $CPFILE` \ | |
clojure.main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment