Skip to content

Commit

Permalink
fix thumbnail script windows issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Mar 21, 2024
1 parent cc92d51 commit 7a4872f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/ci/thumbnails.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def examples_with_thumbnails() -> Generator[Example, None, None]:
def single_language(lang: str) -> Generator[Example, None, None]:
for path in Path(f"examples/{lang}").iterdir():
if (path / "README.md").exists():
readme = (path / "README.md").read_text()
readme = (path / "README.md").read_text(encoding="utf-8")
fm = load_frontmatter(readme)
if fm is not None and fm.get("thumbnail"):
yield Example(path, readme, fm)
Expand Down Expand Up @@ -64,7 +64,9 @@ def work(example: Example):
assert end != -1

(example.path / "README.md").write_text(
example.readme[:start] + f"thumbnail_dimensions = [{width}, {height}]" + example.readme[end:]
example.readme[:start] + f"thumbnail_dimensions = [{width}, {height}]" + example.readme[end:],
encoding="utf-8",
newline='\n',
)

print(f"✔ {example.path}")
Expand Down

0 comments on commit 7a4872f

Please sign in to comment.