-
-
Save aghecht/3048436 to your computer and use it in GitHub Desktop.
clojure bash script
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 | |
# 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