Fork me on GitHub
#babashka
<
2021-10-14
>
andrea.crotti09:10:23

related to the discussion just above, I wonder how are people using babashka and cider together. If you are working on multiple scripts, do you start multiple bb nrepl servers or just use the same one? And you have a different cider repl for each or you normally share that as well?

borkdude09:10:54

it depends. bb supports the concept of a project and classpath

borkdude09:10:51

but there is no default classpath (yet). you have to set it manually like in bb.edn :

{:paths ["."]} ;; add local dir to classpath

andrea.crotti09:10:51

ah ok yeah, maybe to be on the safe side you can start a nrepl-server for each project

borkdude09:10:00

sure, that also works

andrea.crotti09:10:25

just a bit more tricky with the ports I guess, you have to find the next free port to use

andrea.crotti09:10:30

but should not be that hard

borkdude09:10:39

you can start an nrepl server on port 0

borkdude09:10:54

and this will select a free port. you will have to parse that port from the output then to connect

andrea.crotti09:10:04

ah nice that's cool

borkdude09:10:22

we could make bb write an .nrepl-port file but so far I've hesitated if we should do this since there might also be other Clojure REPLs doing that

👍 1
borkdude09:10:41

but in #nbb that is how it works already since @viesti just decided to do this in his implementation

borkdude09:10:51

so perhaps #babashka should also just do it now ;)

andrea.crotti09:10:00

ah yeah, it's likely that were there is a bb script there is also a clojure project in the same project

☝️ 1
borkdude09:10:13

I guess it helps the jack-in process. we could decide to not overwrite existing nrepl-port files or so. it's a tricky problem

indy14:10:58

Is there a way for babashka.curl to not automatically follow redirects? Currently --location seems to be hard coded.

borkdude14:10:13

we can make this optional but right now it's not. a PR is welcome. you can run babashka.curl from source when you require it with the :reload keyword

borkdude14:10:01

a workaround would be shelling out to curl directly with babashka.process or clojure.java.shell, or use the new JDK 11 client (requires Java interop)

indy14:10:55

Thanks for the suggestions @U04V15CAJ. Will see if I can find an ideal workaround.