mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-10 07:17:13 +08:00
Fix: Linebreaks in generated files
This commit is contained in:
@@ -36,7 +36,7 @@ def write_file(file, data):
|
||||
else:
|
||||
lines.append(str(name))
|
||||
|
||||
with open(file, 'w', encoding='utf-8') as f:
|
||||
with open(file, 'w', encoding='utf-8', newline='') as f:
|
||||
f.write('\n'.join(lines))
|
||||
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ def poor_yaml_write(data, file, template_file=DEPLOY_TEMPLATE):
|
||||
value = 'null'
|
||||
text = re.sub(f'{key}:.*?\n', f'{key}: {value}\n', text)
|
||||
|
||||
with open(file, 'w', encoding='utf-8') as f:
|
||||
with open(file, 'w', encoding='utf-8', newline='') as f:
|
||||
f.write(text)
|
||||
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ class ConfigGenerator:
|
||||
lines.append(f' {path_to_arg(path)} = {repr(parse_value(data["value"], data=data))}{option}')
|
||||
visited_path.add(path)
|
||||
|
||||
with open(filepath_code(), 'w') as f:
|
||||
with open(filepath_code(), 'w', encoding='utf-8') as f:
|
||||
for text in lines:
|
||||
f.write(text + '\n')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user