Util.Env (fnord v0.9.40)
View SourceUtilities for interpreting environment variables used in fnord.
Provide canonical parsing helpers so different runtime contexts treat environment values consistently (escript, mix run, CI, etc.).
Reads consult a Services.Globals-scoped override before the real
environment, so a process tree can see a different value than the VM at
large (see put_override/2). In-VM env reads should always route through
this module rather than System.get_env so they honor that scoping.
Summary
Functions
Delete the environment variable.
Return true when the provided environment value is considered truthy.
Set the environment variable to the given value.
Override var for the current Services.Globals scope (process tree).
Reads through this module see the override; the real environment - and
therefore subprocesses - do not. nil makes the variable appear unset.
Functions
@spec cursor_rules_debug_enabled?() :: boolean()
@spec delete_env(binary()) :: :ok
Delete the environment variable.
Return true when the provided environment value is considered truthy.
Recognizes the common truthy values (case-insensitive): "1", "true", and "yes". Returns false for nil, empty strings, and other values.
@spec mcp_debug_enabled?() :: boolean()
Set the environment variable to the given value.
Override var for the current Services.Globals scope (process tree).
Reads through this module see the override; the real environment - and
therefore subprocesses - do not. nil makes the variable appear unset.
This is the async-safe alternative to put_env/2 for tests: System env is
VM-global, so a per-test put/delete races every concurrently running test,
while an override dies with the test's process tree.