View Source env (util v1.3.4)
Environment utils
Link to this section Summary
Functions
Get application configuration
Perform replacement of environment variable values in the OsPath.
Perform replacement of environment variable values in the OsPath. This function also allows to provide a list of Bindings
that override the environment (they are checked before environment variables are looked up).
Link to this section Functions
-spec get_env(atom(), atom(), any()) -> any().
Get application configuration
-spec replace_env_vars(list() | binary()) -> list() | binary().
Perform replacement of environment variable values in the OsPath.
Example:
env:replace_env_vars("~/app") -> "/home/cuser/app"
env:replace_env_vars("${HOME}/app") -> "/home/cuser/app"
env:replace_env_vars("$USER/app") -> "cuser/app"
See also: os:getenv/1.
-spec replace_env_vars(list() | binary(), [{atom() | string(), string()}]) -> list() | binary().
Perform replacement of environment variable values in the OsPath. This function also allows to provide a list of Bindings
that override the environment (they are checked before environment variables are looked up).
Example:
env:replace_env_vars("~/", [{"HOME", "/home/cu"}]) -> "/home/cu/"
env:replace_env_vars("~/", [{home, "/home/cu"}]) -> "/home/cu/"
env:replace_env_vars("$A/", [{a, "/aaa"}]) -> "/aaa/"
env:replace_env_vars("${A}/",[{a, "/aaa"}]) -> "/aaa/"
See also: os:getenv/1.
-spec subst_env_path(list() | binary()) -> list() | binary().
-spec subst_env_path(list() | binary(), [{atom() | string(), string()}]) -> list() | binary().