feat: harden seat intent and expand HIL coverage
This commit is contained in:
@@ -6,7 +6,7 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def load_local_env(path: Path) -> None:
|
||||
def load_local_env(path: Path, *, override: bool = False) -> None:
|
||||
if not path.is_file():
|
||||
return
|
||||
for raw_line in path.read_text(encoding="utf-8").splitlines():
|
||||
@@ -18,6 +18,9 @@ def load_local_env(path: Path) -> None:
|
||||
value = value.strip()
|
||||
if value[:1] == value[-1:] and value.startswith(("'", '"')):
|
||||
value = value[1:-1]
|
||||
if key:
|
||||
os.environ.setdefault(key, value)
|
||||
if key and (override or not os.environ.get(key, "").strip()):
|
||||
# A number of launchers export optional variables as empty strings.
|
||||
# Treat those exactly like an unset value so a deliberate local
|
||||
# development configuration is not silently shadowed.
|
||||
os.environ[key] = value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user