Skip to content

Instantly share code, notes, and snippets.

@mikeananev
Created January 20, 2022 04:45
Show Gist options
  • Save mikeananev/050a22fa6b416116214d886b7ca94ec3 to your computer and use it in GitHub Desktop.
Save mikeananev/050a22fa6b416116214d886b7ca94ec3 to your computer and use it in GitHub Desktop.
babashka tasks as normal functions
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?
borkdude:clj-kondo: 13:26
@mknoszlig 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
(edited)
borkdude:clj-kondo: 13:27
similar approach is used here: https://github.com/weavejester/build/blob/master/bb.edn
@mknoszlig 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> (edited)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment