Fix line ending issues for windows

Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
JCW
2026-03-10 20:33:45 +00:00
parent ef42a8fe6d
commit 199bc0c930

View File

@@ -243,10 +243,10 @@ def generate_from_template(
# Render the template - pass entry_info directly so templates can access any field
content = template.render(**entry_info)
# Write output file
# Write output file in binary mode to avoid any line ending conversion
output_path = Path(output_dir) / f"{entry_info['name']}{output_suffix}"
with open(output_path, "w") as f:
f.write(content)
with open(output_path, "wb") as f:
f.write(content.encode("utf-8"))
print(f"Generated {output_path}")
return output_path