CHANGELOG

This commit is contained in:
Michiel Borkent 2021-04-12 09:47:28 +02:00
parent ac307708ba
commit 00b33dab4d
3 changed files with 13 additions and 2 deletions

View file

@ -8,6 +8,11 @@ Babashka:
- Sort tasks in `bb tasks` output - Sort tasks in `bb tasks` output
Experimental:
- Add `bb run --parallel <task>`
- Fix `:init` in `:tasks`
Deps.clj: Deps.clj:
- Fix arg parsing when invoking from Powershell [#42](https://github.com/borkdude/deps.clj/issues/42) - Fix arg parsing when invoking from Powershell [#42](https://github.com/borkdude/deps.clj/issues/42)

View file

@ -133,7 +133,7 @@
task (get tasks task-name)] task (get tasks task-name)]
(if task (if task
(let [m? (map? task) (let [m? (map? task)
init (and m? (get tasks :init)) init (get tasks :init)
prog (if-let [depends (when m? (:depends task))] prog (if-let [depends (when m? (:depends task))]
(let [targets (target-order tasks task-name)] (let [targets (target-order tasks task-name)]
(loop [prog "" (loop [prog ""
@ -154,7 +154,9 @@
[[(format-task init prog)] nil]) [[(format-task init prog)] nil])
[(binding [*out* *err*] [(binding [*out* *err*]
(println "No such task:" task-name)) 1]))))) (println "No such task:" task-name)) 1])))))
[[(format-task init (assemble-task-1 task-name task parallel? true))] nil])] [[(format-task
init
(assemble-task-1 task-name task parallel? true))] nil])]
(when (= "true" (System/getenv "BABASHKA_DEV")) (when (= "true" (System/getenv "BABASHKA_DEV"))
(println (ffirst prog))) (println (ffirst prog)))
prog) prog)

View file

@ -60,6 +60,10 @@
(bb "foo") (bb "foo")
(is (= "quux\nbaz\nbar\nfoo\n" (slurp out))))) (is (= "quux\nbaz\nbar\nfoo\n" (slurp out)))))
(fs/delete out) (fs/delete out)
(testing "init test"
(test-utils/with-config '{:tasks {:init (def x 1)
foo x}}
(is (= 1 (bb "foo")))))
;; Note: this behavior with :when was complex, since the place where :when ;; Note: this behavior with :when was complex, since the place where :when
;; is inserted isn't very intuitive here ;; is inserted isn't very intuitive here
;; This is why we don't support :when for now ;; This is why we don't support :when for now