Fork me on GitHub
#babashka
<
2021-08-30
>
Dimitar Uzunov06:08:47

Hi guys, is it possible to use a REPL with the bb.edn file? I mean some expressions obviously can be used, but I can’t eval the whole file for example. It is not a big deal as bb starts fast.

borkdude07:08:20

@dimitar.ouzounoff yes, see tasks docs, can link when I’m back at keyboard

👍 2
Dimitar Uzunov07:08:16

is the key part that it starts within a task, rather than the whole file? it should be fine as usually I’m working at one task at a time 🙂

borkdude07:08:59

Tasks are always running in some context, eg as a dependency of some other task, so the ability to start a REPL at any point is useful there. The alternative is to start a REPL yourself and then invoke your tasks with run

Dimitar Uzunov07:08:34

Thanks, will try it out. I was just used to opening the file in emacs and evaling the whole thing but it makes sense now

cldwalker13:08:13

If you'd like to be able to pull up a socket repl on the result of any task e.g. bb foo bar -> bb repl foo bar , https://github.com/cldwalker/bb-clis/blob/98052ae55e360dda00da310def6981f2dc2bcd1a/src/cldwalker/bb_clis/babashka/task.clj#L30-L40 does this nicely

mkvlr14:08:58

is there a recommended way to check for the platform in babashka e.g. if you’re running on linux or macOS? I have´ bb -e "(defn macos? [] (-> (babashka.process/\$ uname) deref :out slurp (clojure.string/includes? \"Darwin\"))) (macos?)" right now but wondering if there’s something better.

borkdude14:08:15

(System/getProperty "os.name") usually

mkvlr14:08:22

thank you!

👍 1
escherize19:08:02

Can I just say that Babashka is the most exciting clojure thing in ages! Thanks to all involved!

babashka 19
5
❤️ 4
4
gratitude 3