Skip to content

Instantly share code, notes, and snippets.

@d9k
Created October 4, 2014 15:17
Show Gist options
  • Save d9k/59f268ed42c8586c4672 to your computer and use it in GitHub Desktop.
Save d9k/59f268ed42c8586c4672 to your computer and use it in GitHub Desktop.
#!/usr/bin/env lein-exec
;; REPL: run as `lein repl` then `(load-file "detect-repl.clj")`
;; CMD: run as `./detect-repl.clj`
;;
;; Where get lein-exec?
;; `wget https://raw.github.com/kumarshantanu/lein-exec/master/lein-exec`
;; see [clojure shellscripting tutorial](https://raw.github.com/kumarshantanu/lein-exec/master/lein-exec)
(println "1 + 2 =" (+ 1 2))
(println (if (not-empty *command-line-args*) "I run from command line" "I run from REPL"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment