Skip to content
Snippets Groups Projects
Verified Commit 5a635473 authored by Jake's avatar Jake
Browse files

dont write unchanged files

parent 86941927
No related branches found
No related tags found
No related merge requests found
Pipeline #318858 passed
......@@ -61,6 +61,14 @@ class Writer:
# write to file
fullpath = self.output_dir + '/' + path
directory = os.path.dirname(fullpath)
if os.path.exists(fullpath):
readmode = 'r'
if 'b' in mode:
readmode = 'rb'
with open(fullpath, readmode) as f:
if out == f.read():
print("skipping writing file: ", fullpath)
return
print("writing file: ", fullpath)
#print("dir: ", directory)
os.makedirs(directory, exist_ok=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment