Skip to content

Commit 5b8be51

Browse files
authored
Merge pull request #139 from ReScienceLab/windows-line-endings
Windows: LF checkouts, a template generator that writes the same bytes, no macOS-only open
2 parents a9f17c1 + 6d80e2c commit 5b8be51

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎.gitattributes‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# A Windows checkout would otherwise turn every line ending into CRLF: the Windows installer
2+
# shipped its skills and templates that way, and a shell script checked out there does not run.
3+
* text=auto eol=lf

‎RELEASE-NOTES.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +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 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.
3539

3640
## v1.5.2
3741

‎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)
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")
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)

‎skills/clone-prototype/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ so there is nothing to restart. If `?canvas=<slug>` opens the wrong page
536536
anyway — right URL, no error — the folder holds no `.html` file yet, and an
537537
empty folder is not a board.
538538

539-
```bash
540-
open "http://127.0.0.1:<port>/?canvas=<slug>"
539+
```
540+
http://127.0.0.1:<port>/?canvas=<slug>
541541
```
542542

543543
`#<file>` after that opens one board in the inspector, with the camera on

0 commit comments

Comments
 (0)