Fork me on GitHub
#babashka
<
2021-05-21
>
borkdude10:05:46

So, changing environment variables in Java isn't supported. But this now works in an experimental branch (called set-env👿

$ ./bb -e "(require '[babashka.os :as os])" -e '(prn (os/set-env "FOO" "BAR")) (prn (os/get-env "FOO"))'
true
"BAR"
Yet, it doesn't compose well with System/getenv, since the Java implementation caches the environment variables on the first call to such methods

borkdude20:05:40

The talk I did back in February at the Graal 2021 workshop at CGO is finally available: Babashka: a native Clojure interpreter for scripting https://youtu.be/Yjeh57eE9rg

babashka 3