Fork me on GitHub
#babashka
<
2023-01-15
>
Carsten Behring20:01:56

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 

lispyclouds21:01:51

you could do something simple like: bb -e '(load-string (slurp ""))' note that it doesnt do redirects

lispyclouds21:01:25

for a better solution and experience id recommend https://github.com/babashka/bbin

👍 2
2
borkdude21:01:10

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

Carsten Behring21:01:56

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.

borkdude21:01:32

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

borkdude21:01:13

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

borkdude21:01:52

Oh wait, I also know another one, you can do:

bb -Sdeps '{:deps {...}}' -x foo.bar/baz 

borkdude21:01:33

Note that your bb project must have a deps.edn in this case if it's going to be used as a library

seancorfield01:01:31

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

👍 4
borkdude08:01:12

Ah nice and then you can use that along with -m or -x

rads23:01:44

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&amp;cid=C0400TZENE7