Skip to content

Commit

Permalink
Change boot.core/boot to be a function instead of a macro (fixes #199)
Browse files Browse the repository at this point in the history
  • Loading branch information
micha committed Apr 25, 2015
1 parent 6623ea8 commit a36d7a0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions boot/core/src/boot/core.clj
Expand Up @@ -690,19 +690,19 @@
(let [fs (commit! (reset-fileset))]
((task-stack #(do (sync-target fs %) (sync-user-dirs!) %)) fs))))

(defmacro boot
(defn boot
"The REPL equivalent to the command line 'boot'. If all arguments are
strings then they are treated as if they were given on the command line.
Otherwise they are assumed to evaluate to task middleware."
[& argv]
(let [->app (fn [xs] `(apply comp (filter fn? [~@xs])))]
`(try @(future
(util/with-let [_# nil]
(#'run-tasks
~(if (every? string? argv)
`(apply #'construct-tasks [~@argv])
(->app argv)))))
(finally (#'do-cleanup!)))))
(try @(future ;; see issue #6
(util/with-let [_ nil]
(run-tasks
(cond (every? fn? argv) (apply comp argv)
(every? string? argv) (apply construct-tasks argv)
:else (throw (IllegalArgumentException.
"Arguments must be either all strings or all fns"))))))
(finally (do-cleanup!))))

;; Low-Level Tasks, Helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Expand Down

0 comments on commit a36d7a0

Please sign in to comment.