| 68 | |
| 69 | |
| 70 | def read_env_file(env_path: Path) -> dict[str, str]: |
| 71 | values: dict[str, str] = {} |
| 72 | if not env_path.exists(): |
| 73 | return values |
| 74 | for raw_line in env_path.read_text(encoding="utf-8").splitlines(): |
| 75 | line = raw_line.strip() |
| 76 | if not line or line.startswith("#") or "=" not in line: |
| 77 | continue |
| 78 | key, value = line.split("=", 1) |
| 79 | values[key.strip()] = value.strip().strip('"').strip("'") |
| 80 | return values |
| 81 | |
| 82 | |
| 83 | def run_command(command: Iterable[str], *, capture_output: bool = False, check: bool = True) -> subprocess.CompletedProcess[str]: |