Skip to content

Commit 6d80e2c

Browse files
Jing-yilinclaude
andcommitted
templates/gen.py: write LF on Windows too
On a Windows 11 machine, regenerating the template folder with the LF checkout marked all eleven files as modified: write_text() translates "\n" to CRLF there. The content diff was empty, but the skills promise a byte-identical regeneration. newline="\n" needs Python 3.10, which is the toolkit's floor already. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 620c085 commit 6d80e2c

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎RELEASE-NOTES.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ Everything below is on `main` and reaches no install until a version is cut.
3232
- **`refkit shoot` works on Windows.** It finds Chrome where the Windows
3333
installer puts it, and uses Edge when Chrome is not there. Before, it only
3434
knew the macOS path.
35-
- **A new board folder's generator writes UTF-8 everywhere.** On a Windows
36-
whose code page is not UTF-8, the template `gen.py` wrote boards in that code
37-
page, so Chinese text or an emoji came out garbled or stopped the run.
35+
- **A new board folder's generator writes the same bytes on Windows.** The
36+
template `gen.py` wrote boards in the Windows code page, so Chinese text or
37+
an emoji came out garbled or stopped the run, and with CRLF line endings, so
38+
regenerating marked every board as changed.
3839

3940
## v1.5.2
4041

‎mockups/canvases/templates/gen.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def page(title, body, extra_css=""):
192192

193193

194194
def write(name, html):
195-
(OUT / (name + ".html")).write_text(html, encoding="utf-8")
195+
(OUT / (name + ".html")).write_text(html, encoding="utf-8", newline="\n")
196196
print(name, len(html))
197197

198198

@@ -462,6 +462,6 @@ def ref_boards():
462462
{"title": "Device shells: " + m + " art, 393 x 852 pt window",
463463
"files": [{"file": n, "label": l} for n, l, _, _ in row]} for m, row in SHELLS],
464464
}
465-
(OUT / "layout.json").write_text(json.dumps(LAYOUT, indent=2) + "\n", encoding="utf-8")
465+
(OUT / "layout.json").write_text(json.dumps(LAYOUT, indent=2) + "\n", encoding="utf-8", newline="\n")
466466
print("layout.json", len(LAYOUT["rows"]), "rows")
467467
print("\nnext: refkit tokens", OUT)

0 commit comments

Comments
 (0)