-
-
Save mmcgrana/237162 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
USER_CLJ_DIR=/Users/mmcgrana/Clojure | |
# Local src, test, and classes | |
CP=src/:test/:classes/ | |
# Local jars | |
if [ -d jars ]; then | |
for file in jars/*.jar; do | |
CP=$CP:$file | |
done | |
fi | |
# Global jars | |
for file in $USER_CLJ_DIR/jars/*.jar; do | |
CP=$CP:$file | |
done | |
# For run.clj & user.clj | |
CP=$CP:$USER_CLJ_DIR | |
if [ -z "$1" ]; then | |
rlwrap java -Xmx2g -cp $CP clojure.contrib.repl_ln | |
else | |
java -Xmx2g -cp $CP clojure.main @run.clj $@ | |
fi |
This file contains hidden or 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
(use 'clj-stacktrace.repl) | |
(import 'clojure.lang.Compiler) | |
(let [script-path (first *command-line-args*) | |
script-args (rest *command-line-args*)] | |
(binding [*command-line-args* script-args] | |
(try | |
(Compiler/loadFile script-path) | |
(catch Exception e | |
(pst-on *err* true e) | |
(System/exit 1))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment