only add newline for non-empty blocks

This commit is contained in:
Paul Gauthier 2023-08-03 16:24:48 -03:00
parent 26ebc715eb
commit 5f7e1d8675

View file

@ -46,7 +46,7 @@ The ORIGINAL block needs to be EXACTLY the same as the lines in {path} with noth
def prep(content):
if not content.endswith("\n"):
if content and not content.endswith("\n"):
content += "\n"
lines = content.splitlines(keepends=True)
return content, lines