Fork me on GitHub

Not sure if this is a common case, but i would like to bundle a set of tasks with a library, and to have them available to consumers of that library (maybe in the form of bb run <lib-name> <task-name>) i haven’t seen anything about that in docs/open issues, so maybe i’m coming from the wrong direction?


@maximilian right now there are these options: • write your tasks as normal functions and make a normal library • use that library in tasks and hook up task names to the library functions • or: use the --config (+ optionally --deps-root ) flags to refer to a different bb.edn


awesome, thanks! will have to meditate on that for a bit 🙂


still figuring out best practices around this, please share your experiences down the road ;)


One more thought I had: we could maybe make bb.edn's executable, by supporting:

#!/usr/bin/env bb
{:tasks ...}
If you would then rename that bb.edn to build or whatever and you would place it on your path, then you could do:
build tasks
build lint
build jar


Or whatever, e.g. for your unwordle project:

unwordle solve ...


I think I'd be a bit surprised if it was suddenly possible to run a deps.edn file directly. But that might just be (lack of) familiarity.


@maximilian you can also just use bb -m foo/bar to run functions instead of tasks


so in your original request, the closest would be bb --config <your-bb.edn> run <task-name>


Not all clojure code is valid babashka - due to the classloader, etc. Is all babashka code valid clojure code? Looking at got me curious if those functions can be run in a normal clojure REPL, provided the right dependencies are present.


> Is all babashka code valid clojure code? Should be

👍 2

Hi babashka users! I've made my first babashka script to generate .gitattributes file with file patterns that should be tracked by git-lfs. It's not about the code. It was more an experiment. I wanted to check how quickly I'll be able to glue things up for something I would normally use shell, Perl, Python or similar language. Wow. The whole process was really, really nice. Fast startup of babashka + nrepl + CIDER combo is really powerful. Thanks @borkdude for this amazing tool! For interested, repo is here:

🎉 1

Thanks for sharing!