Skip to main content

resolve_env_file

Function resolve_env_file 

Source
pub fn resolve_env_file(
    explicit: Option<&Path>,
    no_env_file: bool,
    dir: &Path,
) -> CliResult<Option<PathBuf>>
Expand description

Resolve the .env file to load (if any). Precedence:

  1. If no_env_file is set, return Ok(None).
  2. If explicit is Some(path), the file must exist — otherwise error.
  3. Otherwise, return Some(dir/.env) if it exists, else None.