Skip to content

Instantly share code, notes, and snippets.

@candera
Last active December 19, 2015 16:29
Show Gist options
  • Save candera/5984212 to your computer and use it in GitHub Desktop.
Save candera/5984212 to your computer and use it in GitHub Desktop.
Creates a simple Leiningen project in a throwaway directory, includes dependencies, and starts a REPL.
#!/bin/bash
# Example usage:
#
# lein-play '[org.craigandera/dynne "0.2.0"] [incanter/incanter-core "1.5.1"]'
LIBS=$*
PROJECT_DIR=/tmp/lein-play-`date +%Y%m%d%H%M%S`
mkdir $PROJECT_DIR
cat > ${PROJECT_DIR}/project.clj <<EOF
(defproject playground "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"] ${LIBS}])
EOF
cd ${PROJECT_DIR}
lein repl
@candera
Copy link
Author

candera commented Jul 12, 2013

Huh. Under Cygwin, the resulting REPL won't accept standard input. Some bash weirdness. Need to look into this. Does it work under Linux?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment