babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
Karol Wójcik 2021-05-15T06:48:14.326500Z

I remember that there was a way in babashka to check on which OS bb task is run. I'm trying to find this snippet, but no success so far. Does anybody know where to look at?

borkdude 2021-05-15T07:02:52.327200Z

@karol.wojcik same as in Java, via a Java property

borkdude 2021-05-15T07:40:30.327400Z

@karol.wojcik

$ bb -e '(let [{os-name "os.name" os-arch "os.arch"} (System/getProperties)] [os-name os-arch])'
["Mac OS X" "amd64"]

👍 1
Karol Wójcik 2021-05-15T07:41:39.327700Z

Ok got it! Thanks!

borkdude 2021-05-15T10:39:39.328300Z

The MySQL babashka pod has gone live! You can now interact with MySQL from babashka scripts via the next.jdbc interface. Example: https://github.com/babashka/pod-registry/blob/master/examples/mysql.clj

❤️ 3
borkdude 2021-05-15T15:46:02.329300Z

Made a bb.edn for a native-image based project which includes both Java and Clojure sources: https://github.com/borkdude/trickle/blob/main/bb.edn

borkdude 2021-05-15T15:47:40.330Z

The benefit of this approach is probably that it works on Windows too

grazfather 2021-05-15T18:31:11.330300Z

I’m converting my dotfiles installer to babashka

❤️ 2
borkdude 2021-05-16T19:03:16.335500Z

Cool!

borkdude 2021-05-16T19:03:39.335700Z

Note that if you have a big chunk of code you could also use load-file or paths to move it to a .clj file (completely optional of course)

grazfather 2021-05-16T22:32:20.337500Z

yeah, I plan to, but was actually thinking of moving more of the data to a separate edn. What’s the best way to load that?

borkdude 2021-05-16T22:33:10.337700Z

edn/read-string + slurp

grazfather 2021-05-16T22:33:35.337900Z

and I would love in general if you pointed out anything else I did there that you think I could improve. I am still a clj newbie!

borkdude 2021-05-16T22:37:45.338100Z

ok. spit has an :append true option you could use here: https://github.com/Grazfather/dotfiles/blob/ef3ffc6dfd0de85cd1f25c89456f8790c2abce10/bb.edn#L33

grazfather 2021-05-16T22:45:14.338500Z

oh, I thought I looked for one. Thank you!