fix #1151 - check for symbolic links before removing directories in run_opensfm.py

pull/1152/head
tiagodc 2020-08-24 11:33:12 -03:00
rodzic 74b47be0bd
commit 85ea7c39a4
1 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -34,10 +34,12 @@ class ODMOpenSfMStage(types.ODM_Stage):
self.update_progress(70)
if args.optimize_disk_space:
shutil.rmtree(octx.path("features"))
shutil.rmtree(octx.path("matches"))
shutil.rmtree(octx.path("exif"))
shutil.rmtree(octx.path("reports"))
for folder in ["features", "matches", "exif", "reports"]:
folder_path = octx.path(folder)
if os.path.islink(folder_path):
os.unlink(folder_path)
else:
shutil.rmtree(folder_path)
# If we find a special flag file for split/merge we stop right here
if os.path.exists(octx.path("split_merge_stop_at_reconstruction.txt")):