This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-19
Channels
- # announcements (14)
- # babashka (16)
- # beginners (81)
- # calva (18)
- # chlorine-clover (8)
- # cider (4)
- # clj-kondo (11)
- # cljdoc (4)
- # cljsrn (5)
- # clojure (163)
- # clojure-europe (30)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (4)
- # cursive (3)
- # emacs (12)
- # events (1)
- # figwheel-main (3)
- # fulcro (60)
- # introduce-yourself (3)
- # jackdaw (12)
- # juxt (3)
- # lsp (77)
- # malli (23)
- # mid-cities-meetup (9)
- # music (2)
- # off-topic (12)
- # portal (6)
- # releases (2)
- # shadow-cljs (3)
- # spacemacs (7)
- # sql (1)
- # tools-deps (2)
- # vim (3)
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
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
etc.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.
similar approach is used here: https://github.com/weavejester/build/blob/master/bb.edn
@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 https://github.com/weavejester/build/blob/master/src/weavejester/build/tasks.clj#L1 got me curious if those functions can be run in a normal clojure REPL, provided the right dependencies are present.
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: https://gitlab.com/gigal00p/bb-git-attributes