only used together

This commit is contained in:
Martin Diehl 2021-11-30 13:58:07 +01:00
parent 9cc1e33940
commit 98491c61c8
1 changed files with 1 additions and 2 deletions

View File

@ -14,9 +14,8 @@ def copy_and_patch(patch,orig,marc_root,editor):
except shutil.SameFileError: except shutil.SameFileError:
pass pass
damask.util.run(f'patch {orig.parent/patch.stem} {patch} -b') damask.util.run(f'patch {orig.parent/patch.stem} {patch} -b')
with open(orig.parent/patch.stem) as f_in: with open(orig.parent/patch.stem) as f_in, open(orig.parent/patch.stem,'w') as f_out:
content = f_in.read() content = f_in.read()
with open(orig.parent/patch.stem,'w') as f_out:
f_out.write(content.replace('%INSTALLDIR%',f'{marc_root}').replace('%EDITOR%',editor)) f_out.write(content.replace('%INSTALLDIR%',f'{marc_root}').replace('%EDITOR%',editor))