Skip to content

Instantly share code, notes, and snippets.

@aghecht
Created July 4, 2012 17:21
Show Gist options
  • Save aghecht/3048436 to your computer and use it in GitHub Desktop.
Save aghecht/3048436 to your computer and use it in GitHub Desktop.
clojure bash script
#!/bin/bash
# Clojure wrapper script
# with no arguments runs Clojure's REPL
if [ -n "${CLOJURE_EXT:-}" ]; then
OLD="$IFS"
IFS=":"
EXT="$(find -H $CLOJURE_EXT -mindepth 1 -maxdepth 1 -print0 | tr \\0 \:)"
IFS="$OLD"
if [ -n "${CLASSPATH:-}" ]; then
export CLASSPATH="$EXT$CLASSPATH"
else
export CLASSPATH="${EXT%:}"
fi
fi
if [ "$#" -eq 0 ]; then
java jline.ConsoleRunner clojure.main --repl
else
java jline.ConsoleRunner clojure.main "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment