INNER CODE UNIT · Python

path

feder-cr/Jobs_Applier_AI_Agent_AIHawk · src/aihawk/cli.py:37

    path = Path(directory or Path.cwd()) / ENV_FILE
    if not path.is_file():
        return {}

    # dotenv rather than a hand-rolled parser: quoting, `export ` prefixes,
    # comments and multi-line values are all things a hand-rolled one gets
    # wrong on somebody else's machine, months later.
    from dotenv import dotenv_values

    applied = {}
    for name, value in dotenv_values(path).items():
        if value is None or name in os.environ:
            continue
        os.environ[name] = value
        applied[name] = value
    return applied

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…