This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-15
Channels
- # babashka (13)
- # beginners (37)
- # calva (19)
- # cider (15)
- # clj-kondo (2)
- # clojure (152)
- # clojure-norway (1)
- # clojure-sweden (10)
- # clr (5)
- # emacs (19)
- # honeysql (1)
- # introduce-yourself (19)
- # joyride (1)
- # lsp (4)
- # malli (5)
- # membrane (6)
- # off-topic (11)
- # pathom (18)
- # polylith (13)
- # practicalli (3)
- # releases (4)
- # shadow-cljs (38)
What is the best way to use a certain babashka script from "anywhere" ? I was thinking that it could be nice, if I could execute a "public gist", like this: So the "gist" needed to follow a certain convention of the "main.clj" and the "bb.edn", see my gist as an example.
bb --gist
you could do something simple like:
bb -e '(load-string (slurp "
note that it doesnt do redirects
for a better solution and experience id recommend https://github.com/babashka/bbin
A gist would only work with a single script. When you want to support multiple files, a github repo (not gist) + some config in your bb.edn
will work well with #babashka-bbin
More info about that here: https://github.com/babashka/bbin#bbin-install-script
bbin
will mostly do what I want. 👍
Just saw that " bbin exec" idea was closed.
https://github.com/babashka/bbin/issues/8
Any reason for this ?
I see as well that "install a script" is not always needed.
Some script I just want to run ones, without polluting the machine by installing it.
I don't know why it was closed. Feel free to bring this up in #C0400TZENE7 - @U0CLCL6T0 is the most active maintainer of the bbin project
Alternatively you could just git clone the project, cd into it and then run bb whatever
- and maybe write a small script that does this for you
Oh wait, I also know another one, you can do:
bb -Sdeps '{:deps {...}}' -x foo.bar/baz
Note that your bb project must have a deps.edn
in this case if it's going to be used as a library
You use a multi-file gist as a git dep, at least for clj
, so I'd expect a similar technique would work with bb
? Example: https://gist.github.com/seancorfield/6e8dd10799e9cc7527da5510c739e52f
I think the bb -Sdeps
approach is the right solution here. For my thoughts on bbin exec
see here: https://clojurians.slack.com/archives/C0400TZENE7/p1673998073075109?thread_ts=1673819382.702189&cid=C0400TZENE7