mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-19 01:23:34 +08:00
Fix: Linebreaks in generated files
This commit is contained in:
@@ -36,7 +36,7 @@ def write_file(file, data):
|
|||||||
else:
|
else:
|
||||||
lines.append(str(name))
|
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))
|
f.write('\n'.join(lines))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ def poor_yaml_write(data, file, template_file=DEPLOY_TEMPLATE):
|
|||||||
value = 'null'
|
value = 'null'
|
||||||
text = re.sub(f'{key}:.*?\n', f'{key}: {value}\n', text)
|
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)
|
f.write(text)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ class ConfigGenerator:
|
|||||||
lines.append(f' {path_to_arg(path)} = {repr(parse_value(data["value"], data=data))}{option}')
|
lines.append(f' {path_to_arg(path)} = {repr(parse_value(data["value"], data=data))}{option}')
|
||||||
visited_path.add(path)
|
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:
|
for text in lines:
|
||||||
f.write(text + '\n')
|
f.write(text + '\n')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user