This commit is contained in:
orin
2026-07-30 08:45:38 +08:00
commit 25b24ac4cd
1333 changed files with 170092 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
"""Load local development environment variables without external dependencies."""
from __future__ import annotations
import os
from pathlib import Path
def load_local_env(path: Path) -> None:
if not path.is_file():
return
for raw_line in path.read_text(encoding="utf-8").splitlines():
line = raw_line.strip()
if not line or line.startswith("#") or "=" not in line:
continue
key, value = line.split("=", 1)
key = key.strip()
value = value.strip()
if value[:1] == value[-1:] and value.startswith(("'", '"')):
value = value[1:-1]
if key:
os.environ.setdefault(key, value)