forked from distok/cutthecord
Do not add the new version to the patch README if it's the same as the old one
This commit is contained in:
parent
dedd8883e6
commit
012602f8d3
1 changed files with 9 additions and 8 deletions
17
patchport.py
17
patchport.py
|
@ -196,14 +196,15 @@ for patch in os.listdir(os.path.join(cutthecord_folder, "patches")):
|
||||||
if patch in ["necessary"]:
|
if patch in ["necessary"]:
|
||||||
apply_patch(patch_contents)
|
apply_patch(patch_contents)
|
||||||
|
|
||||||
# Add supported version to readme of that patch, hacky
|
if from_versionname != to_versionname:
|
||||||
# https://stackoverflow.com/a/35130508/3286892
|
# Add supported version to readme of that patch, hacky
|
||||||
with open(readme_path, 'r') as f:
|
# https://stackoverflow.com/a/35130508/3286892
|
||||||
readme_text = f.read().replace(f'- {from_versionname}\n',
|
with open(readme_path, 'r') as f:
|
||||||
f'- {from_versionname}\n'
|
readme_text = f.read().replace(f'- {from_versionname}\n',
|
||||||
f'- {to_versionname}\n')
|
f'- {from_versionname}\n'
|
||||||
with open(readme_path, "w") as f:
|
f'- {to_versionname}\n')
|
||||||
f.write(readme_text)
|
with open(readme_path, "w") as f:
|
||||||
|
f.write(readme_text)
|
||||||
|
|
||||||
# Save ported patch
|
# Save ported patch
|
||||||
with open(out_path, "w") as f:
|
with open(out_path, "w") as f:
|
||||||
|
|
Loading…
Reference in a new issue