how to prevent exit for (shell...)
if exit code is not 0 ? I would like to continue bb script execution.
@mike1452 Not possible yet with that one but you can use babashka.process or clojure.java.shell as an alternative
got it. thanks.
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.
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)
I can understand if there is a design decision to not allow that ,just wanna make sure Iβm just not missing the syntax π
@wilkerlucio 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
I think the options you pointed out are good, not sure if needs any change π
because more stuff means extended semantics, maybe its a good thing to keep the task semantics simple (only call on depends)
yeah sure
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)I have this is ptask
to quickly get it in
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: )
Is there a reason :requires
works differently at the top-level than it does within a task?
@jkrasnay :requires
should be within :tasks
as in:
{:tasks {:requires ([foo.bar :as baz])}}
Oh, I donβt know where I got the idea that it could be at the top level. Thanks!
I made the same mistake as well
When the format stabilizes I will add linting support in clj-kondo
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
This will make future releases of clj-kondo and bb less time consuming for me