fix: use correct UTF-8 encoding on Windows in arcade new (#246)
Fixes the linked issue. Tested on Windows 10
This commit is contained in:
parent
f31cabdf2b
commit
cb5cb7b730
1 changed files with 2 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ def render_template(env: Environment, template_string: str, context: dict) -> st
|
||||||
|
|
||||||
def write_template(path: Path, content: str) -> None:
|
def write_template(path: Path, content: str) -> None:
|
||||||
"""Write content to a file."""
|
"""Write content to a file."""
|
||||||
path.write_text(content)
|
path.write_text(content, encoding="utf-8")
|
||||||
|
|
||||||
|
|
||||||
def create_package(env: Environment, template_path: Path, output_path: Path, context: dict) -> None:
|
def create_package(env: Environment, template_path: Path, output_path: Path, context: dict) -> None:
|
||||||
|
|
@ -61,7 +61,7 @@ def create_package(env: Environment, template_path: Path, output_path: Path, con
|
||||||
else:
|
else:
|
||||||
# Render the file name
|
# Render the file name
|
||||||
file_name = render_template(env, template_path.name, context)
|
file_name = render_template(env, template_path.name, context)
|
||||||
with open(template_path) as f:
|
with open(template_path, encoding="utf-8") as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
# Render the file content
|
# Render the file content
|
||||||
content = render_template(env, content, context)
|
content = render_template(env, content, context)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue