fix
This commit is contained in:
@@ -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)):
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user