babashka/test-resources/bb.edn
Michiel Borkent ca22e8fd04 wip [skip ci]
2021-03-19 11:53:15 +01:00

50 lines
2.3 KiB
Clojure

{:paths ["test-resources/bb-edn"]
:tasks {:count-files {:task/type :shell
:args ["bash" "-c" "ls | wc -l"]}
:bash {:task/type :babashka
:args [:invoke user/bash]}
:eval-plus {:task/type :babashka
:args [-e (apply + (map (fn [i]
(Integer/parseInt i))
*command-line-args*))]}
:describe {:task/type :babashka
:args [:clojure -Sdescribe]}
:do-bash {:task/type :babashka
:args [:do :bash "ls | wc -l"
:__ :eval-plus 1 2 3]}
:all {:task/type :babashka
:args [:do :count-files
:__ :bash "ls | wc -l"
:__ :eval-plus 1 2 3
:__ :describe]}
;;;;
:never-failing-shell
{:task/type :babashka
;; we are executing a shell task, yet we are continueing despite the error code
:args [-e (-> (do (deref (babashka.process/process ["ls" "foobar"] {:inherit true}))
(deref (babashka.process/process ["echo" "done"] {:inherit true}))
nil))]}
:print-hello {:task/type :babashka
:args [-e (println :hello)]}
:always-failing-shell
{:task/type :babashka
;; we are executing a shell task, yet we are continueing despite the error code
:args [-e (babashka.process/check (babashka.process/process ["ls" "foobar"] {:inherit true}))]}
:composed-never-failing {:task/type :babashka
:args [:do :never-failing-shell
:__ :print-hello]}
:composed-failing {:task/type :babashka
:args [:do :always-failing-shell
:__ :print-hello]}
,
;;;; context (not implemented)
:put-answer-in-ctx {:type/task :babashka
:args [:eval-plus 1 2 3]
:out [:answer]}
:print-answer {:type/task :babashka
:in {:sum [:answer]}
:args [-e (println $sum)]}
}
}