Skip to content

Instantly share code, notes, and snippets.

@stantont
Created November 19, 2009 03:54
Show Gist options
  • Select an option

  • Save stantont/238535 to your computer and use it in GitHub Desktop.

Select an option

Save stantont/238535 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Clojure command-line startup file cobbled together from different--forgotten--sources
BREAK_CHARS="(){}[],^%$#@\"\";:''|\\"
JAR_DIR=/Users/stantont/lib/java/jars
CLOJURE_JAR=$JAR_DIR/clojure.jar
CONTRIB_JAR=$JAR_DIR/clojure-contrib.jar
COMPLETIONS=""
if [ -e $HOME/.clj/completions ]; then
COMPLETIONS="-f $HOME/.clj/completions"
else
if [ -e $HOME/.clj_completions ]; then
COMPLETIONS="-f $HOME/.clj_completions"
fi
fi
if [ $# -eq 0 ]; then
#install rlwrap with MacPorts on Mac
rlwrap --remember -c -b $BREAK_CHARS $COMPLETIONS \
java -cp $CLOJURE_JAR:$CONTRIB_JAR clojure.lang.Repl
else
java -cp $CLOJURE_JAR clojure.lang.Script "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment