nova-sim / robots /ur5 /env_loader.py
Georg
Add environment loading utility and integrate into Nova API and Jogger
07bb707
"""
Utility helpers for loading Nova-related environment files.
"""
import os
from pathlib import Path
def load_local_env() -> None:
"""Load `.env.local` from the nova-sim root so configs pick up saved credentials."""
root = Path(__file__).resolve().parents[2]
env_path = root / ".env.local"
if not env_path.exists():
return
with env_path.open("r") as fp:
for raw in fp:
line = raw.strip()
if not line or line.startswith("#") or "=" not in line:
continue
key, value = line.split("=", 1)
os.environ.setdefault(key.strip(), value.strip())