fix: incorrect file removal loop

This commit is contained in:
2026-01-27 23:34:09 +00:00
parent 338de19d57
commit 6d11eab503

View File

@@ -46,12 +46,7 @@ def cleanup_state_files() -> None:
files = state.get("files", []) files = state.get("files", [])
# Remove old files from state # Remove old files from state
for file in files: state["files"] = [file for file in files if not os.path.exists(file["path"])]
if not os.path.exists(file["path"]):
files.remove(file)
print(f"Removed non-existent file from state: {file['path']}")
state["files"] = files
write_state(state) write_state(state)
def create_state_file_if_needed() -> None: def create_state_file_if_needed() -> None: