This commit is contained in:
2026-04-02 23:08:41 +02:00
parent 3326c407b7
commit f77211bd2e
2 changed files with 2 additions and 6 deletions

View File

@@ -84,7 +84,7 @@ class BuildContext:
def _stringify(value: Any) -> str:
if isinstance(value, bool):
return "1" if value else "0"
return "True" if value else "False"
if value is None:
return ""
if isinstance(value, (list, tuple)):

View File

@@ -8,12 +8,8 @@ def _escape(value: str) -> str:
value = value.replace('\\', '\\\\').replace('"', '\\"')
return f'"{value}"'
def write_env_file(path: Path, values: Mapping[str, str]) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
with path.open('w', encoding='utf-8') as handle:
for key in sorted(values):
_val = values[key]
if isinstance(_val,bool):
_val = "True" if _val is True else "False"
handle.write(f'{key}={_escape(str(_val))}\n')
handle.write(f'{key}={_escape(str(values[key]))}\n')