babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
borkdude 2021-03-20T13:19:43.132600Z

@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)))))

borkdude 2021-03-20T13:21:42.133900Z

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 ?

borkdude 2021-03-20T13:23:42.134300Z

I think the bash equivalent of that is ;

borkdude 2021-03-20T13:25:53.134600Z

:regardless-do ?

borkdude 2021-03-20T13:26:12.134800Z

or just :do

borkdude 2021-03-20T13:26:24.135Z

yeah, that might work

grazfather 2021-03-20T13:35:50.135400Z

or-do makes sense to me but I get how it could sound confusing

grazfather 2021-03-20T13:36:26.136100Z

it could be misleading in a few ways

grazfather 2021-03-20T13:36:39.136500Z

and-do might imply short-circuiting (do the first that succeeds and stop)

grazfather 2021-03-20T13:37:19.136700Z

:then-do?

borkdude 2021-03-20T13:37:49.137Z

I now implemented :or-do as shortcutting

borkdude 2021-03-20T13:38:03.137300Z

same as && and || in the shell

borkdude 2021-03-20T13:38:10.137600Z

and just :do will always continue

borkdude 2021-03-20T13:38:15.137800Z

:do :foo :do :bar

grazfather 2021-03-20T13:39:18.138100Z

kk