Skip to content

Instantly share code, notes, and snippets.

@bizenn
Created September 6, 2011 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bizenn/1197002 to your computer and use it in GitHub Desktop.
Save bizenn/1197002 to your computer and use it in GitHub Desktop.
swank-clojure easy wrapper script.
#!/bin/sh
# swank-clojure easy wrapper
# This requires lein deps or mvn deps.
DEST=$1
if [ -z ${DEST} ]; then
DEST=.
fi
cd ${DEST}
if [ -f project.clj ]; then
exec env \
LANG=ja_JP.UTF-8 \
JAVA_OPTS="-Dswank.encoding=utf-8-unix -Dfile.encoding=UTF-8" \
lein swank
elif [ -f pom.xml ]; then
exec env \
LANG=ja_JP.UTF-8 \
MAVEN_OPTS="${MAVEN_OPTS} -Dclojure.swank.encoding=utf-8-unix -Dfile.encoding=UTF-8" \
mvn clojure:swank
else
echo "You can specify only a project directory including \"project.clj\" or \"pom.xml\"."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment