I'm wondering if ammonite has a convenient, shorthand way to access environment variables from the parent process, or is scala.util.Properties.envOrElse
the suggested method? (How to read environment variables in Scala)
Related: is there a way to list all current objects in ammonite? Somewhat analogous to env
in bash, though possibly different, as it seems that environment variables are not imported as vals or vars.
There is
sys.env
(Scala default import - available in Scala REPL too). You can use theshow
function in ammonite to avoid truncation in printed output.Example:
show(sys.env)
sys.env("HOME")