From faee213658609a51e34eaaa616ab5de844ee198e Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Wed, 28 Dec 2022 22:59:00 -0400 Subject: [PATCH] chore: add command for updating master.zig on windows (#859) --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 806e60c..f2520e8 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,13 @@ zig build -Drelease-safe There is a `generate-data.py` in the `src/data` folder, run this file to update data files. It writes to stdout and you can redirect output to a zig file like `master.zig`. By default it generates data file for `master`, but can be configured to generate for a different version by modifying the `zig_version` variable. Files generated by this tool **contains** formatting information. +On Powershell 5.1 (the default Powershell on Windows 10 & 11), the following will update `master.zig`. +```pwsh +New-Item -Force .\src\data\master.zig -Value ((python .\src\data\generate-data.py) -split "`r?`n" -join "`n") +``` + +This unweidly command is necesary in order to guarantee Unix-style line endings and UTF-8 text encoding. + There is also a `generate-data.js` in the `src/data` folder, you'll need to run this inside a Chrome DevTools console and copy the output. Files generated by this tool **does not contain** formatting information. ### Configuration Options