(defn -main
([& [task-name & args]]
(let [task-name (or (@aliases task-name) task-name "help")
args (if (@no-project-needed task-name)
args
(conj args (read-project)))
compile-path (:compile-path (first args))]
(when compile-path (.mkdirs (File. compile-path)))
(binding [*compile-path* compile-path]
(load-hooks)
;; TODO: can we catch only task-level arity problems here?
;; compare args and (:arglists (meta (resolve-task task)))?
(let [task (resolve-task task-name)
value (apply task args)]
(when (integer? value)
(System/exit value))))))
([] (apply -main (or *command-line-args* ["help"]))))
Used in 0 other vars
Comments top
No comments for -main. Log in to add a comment.