Skip to main content

Module env_loader

Module env_loader 

Source
Expand description

Resolve a .env file path and auto-discover a pipeline config file.

Both helpers take an explicit “from” directory so unit tests can run in a tempdir without touching process cwd. Production call-sites pass std::env::current_dir()? as the third argument.

Functions§

discover_config_path
Probe dir for faucet.yaml, faucet.yml, then faucet.json. Returns the first match in priority order, or None. When more than one candidate is present, emits a tracing::warn! naming the runner-ups so a stale faucet.yml next to the canonical faucet.yaml doesn’t go unnoticed.
load_env_file_if_present
Load the resolved .env via dotenvy::from_path. No-op when path is None. Process-env values always win over .env-supplied ones — that’s the dotenvy default and we deliberately don’t override it.
resolve_env_file
Resolve the .env file to load (if any). Precedence: