Skip to content

Commit

Permalink
🐛 use pathlib idiom for template rendering
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Jun 20, 2024
1 parent 528abd8 commit 89ff2d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ozi/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ def render_templates(env: Environment, target: Path) -> None:
"""
for i in ['.release_notes.md.j2', 'CHANGELOG.md.j2', 'parsed_commit_heading.j2']:
template = env.get_template(f'templates/{i}')
with open(target / 'templates' / i, 'w', encoding='UTF-8') as f:
f.write(template.render())
f = target / 'templates' / i
f.parent.mkdir(exist_ok=True, parents=True)
f.write_text(template.render())


def render_project_files(env: Environment, target: Path, name: str) -> None:
Expand Down

0 comments on commit 89ff2d6

Please sign in to comment.