Skip to content

Instantly share code, notes, and snippets.

@arrdem
Created February 22, 2016 16:27
Show Gist options
  • Save arrdem/3e4fe82a583368dc9d83 to your computer and use it in GitHub Desktop.
Save arrdem/3e4fe82a583368dc9d83 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ ! -f `which lein` ];
then
echo "Install leiningen from https://github.com/technomancy/leiningen"
exit
else
ROOT=`mktemp -d`
cd $ROOT
cat <<EOF > $ROOT/project.clj
(defproject test "0.0.0"
:dependencies [[me.arrdem/clojarr "1.9.0-e3f38f1-SNAPSHOT"]])
EOF
cat <<EOF | lein repl
;; just make some defs
(ns foo)
(def a 1)
(def b 2)
;; reset (reload) the ns
(ns foo)
;; refresh one def
(def a 1)
;; b hasn't been refreshed, should warn
foo/b
(in-ns 'user)
;; this should work
foo/a
;; this should warn
foo/b
;; these should work
(defn af [] foo/a)
(af)
;; these should warn
(defn bf [] foo/b)
(bf)
EOF
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment