Write `text` as UTF-8 with LF endings on every platform.
(path: Path, text: str)
| 210 | |
| 211 | |
| 212 | def _write_lf(path: Path, text: str) -> None: |
| 213 | """Write `text` as UTF-8 with LF endings on every platform.""" |
| 214 | normalized = text.replace("\r\n", "\n").replace("\r", "\n") |
| 215 | path.write_bytes(normalized.encode("utf-8")) |
| 216 | |
| 217 | |
| 218 | def main(argv: list[str]) -> int: |