build.run: in BuildPlan.execute_local, always use LF line endings.

This way the files are written identically on *nix and Windows.

Fixes #732.
This commit is contained in:
Catherine 2023-01-30 11:48:28 +00:00
parent a704b1b218
commit dafefa87a9
2 changed files with 4 additions and 2 deletions

View file

@ -84,8 +84,9 @@ class BuildPlan:
if dirname:
os.makedirs(dirname, exist_ok=True)
mode = "wt" if isinstance(content, str) else "wb"
with open(filename, mode) as f:
if isinstance(content, str):
content = content.encode("utf-8")
with open(filename, "wb") as f:
f.write(content)
if run_script: