not sure why this does not work
This commit is contained in:
Martin Diehl 2021-12-01 11:46:48 +01:00
parent 717ca3e727
commit f6d2bd0225
1 changed files with 4 additions and 2 deletions

View File

@ -14,8 +14,10 @@ def copy_and_patch(patch,orig,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, open(orig.parent/patch.stem,'w') as f_out: with open(orig.parent/patch.stem) as f_in:
f_out.write(f_in.read().replace('%EDITOR%',editor)) content = f_in.read()
with open(orig.parent/patch.stem,'w') as f_out:
f_out.write(content.replace('%EDITOR%',editor))
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(