Fork me on GitHub
#babashka
<
2021-04-20
>
mike_ananev07:04:19

how to prevent exit for (shell...)if exit code is not 0 ? I would like to continue bb script execution.

borkdude07:04:44

@mike1452 Not possible yet with that one but you can use babashka.process or clojure.java.shell as an alternative

mike_ananev07:04:02

got it. thanks.

borkdude10:04:58

Found another good use for fs/modified-since: https://gist.github.com/borkdude/35bc0a20bd4c112dec2c5645f67250e3#file-1-bb-edn-L2-L5 We rebuild our deps.edn from a template when any relevant files on which it depends changes, when invoking any task.

👍 6
wilkerlucio19:04:14

currently in babashka tasks, is there a way to invoke one task from another? (other than using :depends, I like to have more control over the execution order)

wilkerlucio19:04:27

I can understand if there is a design decision to not allow that ,just wanna make sure I’m just not missing the syntax 🙂

borkdude19:04:51

@U066U8JQJ currently the options are: create functions either in :init or in a script and use functional programming... or use (do (shell "bb clean") ...) to invoke a task from within bb. I do want to support this better but I haven't found a satisfying syntax yet

wilkerlucio19:04:41

I think the options you pointed out are good, not sure if needs any change 👍

wilkerlucio19:04:01

because more stuff means extended semantics, maybe its a good thing to keep the task semantics simple (only call on depends)

wilkerlucio20:04:58

one any snippet I’m using with babashka tasks:

-$TASK$
{:depends [$DEPS$]}

$TASK$
(shell "bb run --parallel -$TASK$")
(this is using IntelliJ format, but easy to port over to other snippet systems)

🎉 3
wilkerlucio20:04:22

I have this is ptask to quickly get it in

jkrasnay20:04:26

I have a bb.edn like this: {:tasks {hello {:requires [[babashka.fs :as fs]] :task (println "hello")}}} that works fine. But if I refactor it like this: {:requires [[babashka.fs :as fs]] :tasks {hello {:task (println "hello")}}}`` it tries to download an updated clojure-tools.jar (and fails due to work’s egress firewall :face_with_rolling_eyes: )

jkrasnay20:04:50

Is there a reason :requires works differently at the top-level than it does within a task?

borkdude21:04:43

@jkrasnay :requires should be within :tasks

borkdude21:04:28

as in:

{:tasks {:requires ([foo.bar :as baz])}}

jkrasnay21:04:16

Oh, I don’t know where I got the idea that it could be at the top level. Thanks!

borkdude21:04:03

I made the same mistake as well

borkdude21:04:22

When the format stabilizes I will add linting support in clj-kondo

borkdude22:04:36

Finally made a bb script/lib to update a github release with artifacts from multiple steps and even from two different CIs: https://github.com/borkdude/gh-release-artifact

borkdude22:04:52

This will make future releases of clj-kondo and bb less time consuming for me

🎉 27
awesome 9