[#837] Add babashka.task System property
This commit is contained in:
parent
5014012bd6
commit
7462d86afd
2 changed files with 8 additions and 2 deletions
|
|
@ -745,8 +745,10 @@ Use bb run --help to show this help output.
|
|||
ns var-name)] nil])
|
||||
run (if (:run-help cli-opts)
|
||||
[(print-run-help) 0]
|
||||
(do
|
||||
(System/setProperty "babashka.task" (str run))
|
||||
(tasks/assemble-task run
|
||||
(:parallel-tasks cli-opts)))
|
||||
(:parallel-tasks cli-opts))))
|
||||
file (try [[(read-file file)] nil]
|
||||
(catch Exception e
|
||||
(error-handler e {:expression expressions
|
||||
|
|
|
|||
|
|
@ -192,6 +192,10 @@
|
|||
(test-utils/with-config '{:tasks {b {:doc "Beautiful docstring"}}}
|
||||
(let [s (test-utils/bb nil "doc" "b")]
|
||||
(is (= "-------------------------\nb\nTask\nBeautiful docstring\n" s)))))
|
||||
(testing "system property"
|
||||
(test-utils/with-config '{:tasks {b (System/getProperty "babashka.task")}}
|
||||
(let [s (bb "run" "--prn" "b")]
|
||||
(is (= "b" s)))))
|
||||
|
||||
(deftest list-tasks-test
|
||||
(test-utils/with-config {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue