From 4707704330f7e0e13cdd5ec5ac1620e03589e204 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Thu, 16 May 2024 21:55:14 +0800 Subject: [PATCH] [F] Fix rehash --- tools/build_rehash.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/build_rehash.py b/tools/build_rehash.py index 776e375d..94236d46 100644 --- a/tools/build_rehash.py +++ b/tools/build_rehash.py @@ -60,9 +60,10 @@ if __name__ == '__main__': new_record = [] for file in order: file = base_path / file.split(',')[0] - digest, length = rehash(file) - new_record.append(f"{str(file.relative_to(base_path)).replace("\\", "/")},{digest},{length}") - processed.add(file) + if file.exists(): + digest, length = rehash(file) + new_record.append(f"{str(file.relative_to(base_path)).replace("\\", "/")},{digest},{length}") + processed.add(file) for file in base_path.rglob('*'): if file.is_file() and file not in processed: