Properly cleanup old manifest from the cloned /data directory

This commit is contained in:
themylogin
2024-02-14 12:49:00 +01:00
parent a64fae0903
commit 1827421be6

View File

@@ -464,12 +464,14 @@ def main():
for excluded in data_exclude:
remove = f"{root}/{excluded}"
try:
shutil.rmtree(remove, True)
shutil.rmtree(remove)
except NotADirectoryError:
try:
os.unlink(remove)
except FileNotFoundError:
pass
except FileNotFoundError:
pass
exclude_list = []
for walk_root, dirs, files in os.walk(root):