diff options
-rw-r--r-- | launchers/bash/clj-env-dir | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/launchers/bash/clj-env-dir b/launchers/bash/clj-env-dir new file mode 100644 index 00000000..fc81e9fc --- /dev/null +++ b/launchers/bash/clj-env-dir @@ -0,0 +1,52 @@ +#!/bin/bash + +# Copyright (c) Stephen C. Gilardi. All rights reserved. The use and +# distribution terms for this software are covered by the Eclipse Public +# License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can be +# found in the file epl-v10.html at the root of this distribution. By +# using this software in any fashion, you are agreeing to be bound by the +# terms of this license. You must not remove this notice, or any other, +# from this software. +# +# clj-env-dir Launches Clojure, passing along command line arguments. This +# launcher is configured using environment variables and sets +# up CLASSPATH based on the contents of a specified directory. +# +# scgilardi (gmail) +# Created 7 January 2009 +# +# Environment variables: +# +# Required: +# +# CLOJURE_EXT The path to a directory containing (either directly or as +# symbolic links) jar files and/or directories whose paths +# should be included in CLASSPATH. These paths will be +# prepended to any prior definition of the CLASSPATH +# environment variable. +# +# Optional: +# +# CLOJURE_JAVA The command to launch a JVM instance for Clojure +# default: java +# example: /usr/local/bin/java6 +# +# CLOJURE_OPTS Java options for this JVM instance +# default: +# example:"-Xms32M -Xmx128M -server" +# +# CLOJURE_MAIN The Java class to launch +# default: clojure.main +# example: clojure.contrib.repl_ln + +set -o errexit +set -o nounset +#set -o xtrace + +EXT="$(find ${CLOJURE_EXT} -mindepth 1 -maxdepth 1 -print0 | tr \\0 \:)" + +JAVA=${CLOJURE_JAVA:-java} +OPTS=${CLOJURE_OPTS:-} +MAIN=${CLOJURE_MAIN:-clojure.main} + +CLASSPATH="${EXT}${CLASSPATH:-}" exec $JAVA $OPTS $MAIN "$@" |