Skip to main content

load_env_for_mode

Function load_env_for_mode 

Source
pub fn load_env_for_mode(
    manifest: Option<&Manifest>,
    start_dir: &Path,
) -> Result<Option<PathBuf>>
Expand description

Load environment variables from a .env file before any tool that reads GITHUB_TOKEN / API credentials runs.

Resolution order:

  1. If the manifest sets env_file:, load that path (error if missing).
  2. Otherwise walk upward from start_dir looking for a .env.

Returns the path actually loaded (for boot-summary logging), or None if nothing was found. Existing env vars are never overwritten.