Search results

There are no results.

std.env.variables

Show source code
Hide source code
fn pub variables -> Map[String, String] {
  let vars = Map.new
  let mut idx = 0
  let len = inko_env_size(_INKO.state) as Int

  while idx < len {
    let key = inko_env_get_key(_INKO.state, idx)

    match opt(key) {
      case Some(val) -> {
        vars.set(key, val)
        nil
      }
      case _ -> {}
    }

    idx += 1
  }

  vars
}
fn pub static variables -> Map[String, String]

Returns all defined environment variables and their values.

Examples

Obtaining all environment variables and their values:

import std.env

env.variables.opt('HOME') # => Option.Some('/home/alice')