Fork me on GitHub
#babashka
<
2023-08-02
>
Ferdinand Beyer07:08:30

Is there a bb flag to disable interpreting args as tasks? Say I’ve defined a repl task in bb.edn, can I somehow still run a bb REPL? bb repl will now run my task… :face_palm: (I know I should probably choose a different task name, just wondering if there was a different way)

2
borkdude08:08:38

You can run bb --repl to not invoke it as a task

🙌 2
borkdude08:08:59

bb should probably warn about overridden stuff, there's an issue for it, that I'll work on for the next release

Ferdinand Beyer08:08:39

I think as long as subcommands can be “forced” by prefixing them with --, an override warning would not be important to me. Could actually be nice to use bb as a general CLI for a clojure project and override more commands such as bb help… Then again it’s probably cleaner to create a shell script that rewrites ./cli <cmd> [<args>...] to bb run <cmd> <args>…

borkdude08:08:03

yeah and ./cli <cmd> ... you can easily do with babashka.cli which is built in

jeroenvandijk10:08:53

Is there already a Clojure library that mimics Babashka?

2
jeroenvandijk10:08:21

I’m working on a tool and I prefer to develop it from a Clojure nrepl (slightly better repl output). But with a plain Clojure project I’m missing the dependencies of Babashka

borkdude10:08:45

you can use bb print-deps for this to emit a deps.edn

🎉 2
jeroenvandijk10:08:56

ah cool, I’ll try that

Ingy döt Net16:08:49

bb repl (and rlwrap bb repl) seem to provide a not great repl environment. I'm guessing that's not a high priority since the bb docs don't say much except how to start it, and then go on to talk about all the other repl (server) options to use...

Ingy döt Net16:08:26

not a criticism of bb. just installed it and reading about it and looks awesome. just wondering whether issues with the bb repl command are worth bringing up or not.

borkdude17:08:30

the bb repl is just as basic as the clj REPL. The preferred way of using a REPL in Clojure is not on the terminal but connected to your editor

👍 2
borkdude17:08:02

there's better options like https://github.com/bhauman/rebel-readline, but those are currently not in scope for bb as it would require dragging in dependencies that you likely wouldn't use otherwise and those would bloat the binary. You could also just develop your project in regular JVM Clojure and then run it with bb for faster startup. You can print the bundled dependencies with bb print-deps