Skip to content
alandipert edited this page Dec 13, 2014 · 19 revisions

It's possible to create self-contained, executable Clojure scripts that can bring in Maven dependencies, using a shebang. Here is an example that runs a game like Lunar Lander:

Put this into a file called lunarlander.boot:

#!/usr/bin/env boot

(set-env! :dependencies '[[alandipert/hyperturbo "0.0.1-SNAPSHOT"]])
(require '[alandipert.hyperturbo.lunar-lander :refer [run]])

(defn -main [& args]
  (run))

Make the file executable:

chmod +x lunarlander.boot

Run the script:

./lunarlander.boot
Clone this wiki locally