Rename exit-with-error to abort.
This commit is contained in:
parent
83ab2890b0
commit
66b4ed91e2
1 changed files with 6 additions and 6 deletions
|
@ -34,7 +34,7 @@
|
||||||
;; So it doesn't need to be fully-qualified in project.clj
|
;; So it doesn't need to be fully-qualified in project.clj
|
||||||
(with-ns 'clojure.core (use ['leiningen.core :only ['defproject]]))
|
(with-ns 'clojure.core (use ['leiningen.core :only ['defproject]]))
|
||||||
|
|
||||||
(defn exit-with-error [msg]
|
(defn abort [msg]
|
||||||
(println msg)
|
(println msg)
|
||||||
(System/exit 1))
|
(System/exit 1))
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
(load-file file)
|
(load-file file)
|
||||||
project
|
project
|
||||||
(catch java.io.FileNotFoundException _
|
(catch java.io.FileNotFoundException _
|
||||||
(exit-with-error "No project.clj found in this directory."))))
|
(abort "No project.clj found in this directory."))))
|
||||||
([] (read-project "project.clj")))
|
([] (read-project "project.clj")))
|
||||||
|
|
||||||
(def aliases {"--help" "help" "-h" "help" "-?" "help"
|
(def aliases {"--help" "help" "-h" "help" "-?" "help"
|
||||||
|
@ -57,8 +57,8 @@
|
||||||
(let [task-ns (symbol (str "leiningen." task))
|
(let [task-ns (symbol (str "leiningen." task))
|
||||||
task (symbol task)
|
task (symbol task)
|
||||||
error-fn (fn [& _]
|
error-fn (fn [& _]
|
||||||
(exit-with-error
|
(abort
|
||||||
(format "%s is not a task. Use \"help\" to list all tasks."
|
(format "%s is not a task. Use \"help\" to list all tasks."
|
||||||
task)))]
|
task)))]
|
||||||
(try
|
(try
|
||||||
(require task-ns)
|
(require task-ns)
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
(try
|
(try
|
||||||
(apply (resolve-task task) args)
|
(apply (resolve-task task) args)
|
||||||
(catch IllegalArgumentException _
|
(catch IllegalArgumentException _
|
||||||
(exit-with-error (format "Wrong number of arguments to task %s."
|
(abort (format "Wrong number of arguments to task %s."
|
||||||
task)))))
|
task)))))
|
||||||
;; In case tests or some other task started any:
|
;; In case tests or some other task started any:
|
||||||
(shutdown-agents)))
|
(shutdown-agents)))
|
||||||
|
|
Loading…
Reference in a new issue