Fork me on GitHub
#babashka
<
2021-12-05
>
awb9912:12:03

I would like to combine tasks, where one task outputs something to (presumably stdout), and the next task reads this output. Is there an example somewhere how to do that?

borkdude12:12:08

@hoertlehner Tasks already can be used to return values.

{:tasks {a 1 b {:depends [a] :task (inc a)}}}

borkdude12:12:26

$ bb run --prn a
1
$ bb run --prn b
2

borkdude12:12:46

@hoertlehner Would that solve your problem?

introom13:12:25

Come across this piece of code:

:tasks {app    tasks/app
         deps   tasks/fix-deps
         ci     tasks/ci
         clean  tasks/clean
         check  tasks/check
         dev    tasks/dev

introom13:12:44

Why app is not keyword, :app. Is the above valid end? (source https://github.com/djblue/portal/blob/master/bb.edn#L3)

borkdude13:12:14

yes, symbols are allowed in EDN :)

introom13:12:53

Yup. Symbols are allowed.

borkdude13:12:36

task names are indicated by symbols

borkdude13:12:59

the right hand side is simply a reference to a function in a namespace which will be executed when you run the task

awb9913:12:57

@borkdude: thanks! the 1 that is returned by a, is this a edn value? Could I make this also if a would do (println "123")

awb9913:12:34

ahhh. or I guess I could take the return value of a shell function call and give this back in a task...

borkdude13:12:37

you could take the string output from a shell call, print it and return it

introom14:12:53

Is there any babashka prebuilt for macbook pro m1 arm chips?

borkdude14:12:37

Not yet, waiting for GraalVM support

introom15:12:41

Do you happen to know I can still run it even it is x64? (Have no m1 at hand right now)

borkdude15:12:05

Yes, runs fine with Rosetta2