Skip to content

Instantly share code, notes, and snippets.

@kyleburton
Created March 9, 2011 14:02
Show Gist options
  • Save kyleburton/862226 to your computer and use it in GitHub Desktop.
Save kyleburton/862226 to your computer and use it in GitHub Desktop.
Attempts to run Swank regardless of project type (Lein, Maven).
function swank () {
PORT="${1:-4005}"
if [ -e project.clj ]; then
slime-connect & ## see gist: https://gist.github.com/866324
lein deps; lein swank "$PORT"
elif [ -e pom.xml ]; then
slime-connect &
if [ -e patch.dev.pom.xml.patch ]; then
cp pom.xml dev.pom.xml
patch -p0 < patch.dev.pom.xml.patch
mvn -Dclojure.swank.port=$PORT -f dev.pom.xml clojure:swank
else
mvn -Dclojure.swank.port=$PORT clojure:swank
fi
else
echo "Sorry: don't know how to run a swank server in $(pwd)"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment