Fork me on GitHub
#babashka
<
2021-05-15
>
Karol Wójcik06:05:14

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?

borkdude07:05:52

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

borkdude07:05:30

@karol.wojcik

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

👍 2
Karol Wójcik07:05:39

Ok got it! Thanks!

borkdude10:05:39

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

❤️ 8
borkdude15:05:02

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

borkdude15:05:40

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

grazfather18:05:11

I’m converting my dotfiles installer to babashka

❤️ 4
borkdude19:05:39

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)

grazfather22:05:20

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?

borkdude22:05:10

edn/read-string + slurp

grazfather22:05:35

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!

grazfather22:05:14

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