@grazfather I settled on :and-do
and :or-do
:
(testing ":and-do failing"
(with-config {:tasks {:div-by-zero {:task/type :babashka
:args ["-e" "(/ 1 0)"]}
:sum {:task/type :babashka
:args ["-e" "(+ 1 2 3)"]}
:all {:task/type :babashka
:args [:do :div-by-zero :and-do :sum]}}}
(is (thrown-with-msg? Exception #"Divide"
(bb :all)))))
(testing ":or-do succeeding"
(with-config {:tasks {:div-by-zero {:task/type :babashka
:args ["-e" "(/ 1 0)"]}
:sum {:task/type :babashka
:args ["-e" "(+ 1 2 3)"]}
:all {:task/type :babashka
:args [:do :div-by-zero :or-do :sum]}}}
(is (= 6 (bb :all)))))
which may not be the correct name either, since :or
will imply something like short-cutting on the first non-failing one, but I was thinking of ||
in the shell. Maybe I should have another one... :always-do
?
I think the bash equivalent of that is ;
:regardless-do
?
or just :do
yeah, that might work
or-do makes sense to me but I get how it could sound confusing
it could be misleading in a few ways
and-do might imply short-circuiting (do the first that succeeds and stop)
:then-do
?
I now implemented :or-do
as shortcutting
same as &&
and ||
in the shell
and just :do
will always continue
:do :foo :do :bar
kk