Spaces:
Running
Running
feat: skip and remove stale backup entries during OpenClaw state restoration
Browse files- workspace-sync.py +7 -0
workspace-sync.py
CHANGED
|
@@ -122,6 +122,13 @@ def restore_embedded_state() -> None:
|
|
| 122 |
print("🧠 Restoring OpenClaw state...")
|
| 123 |
for source_path in state_backup_root.iterdir():
|
| 124 |
name = source_path.name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
target_path = OPENCLAW_HOME / name
|
| 126 |
shutil.rmtree(target_path, ignore_errors=True)
|
| 127 |
if target_path.is_file():
|
|
|
|
| 122 |
print("🧠 Restoring OpenClaw state...")
|
| 123 |
for source_path in state_backup_root.iterdir():
|
| 124 |
name = source_path.name
|
| 125 |
+
if name in EXCLUDED_STATE_NAMES:
|
| 126 |
+
if source_path.is_dir():
|
| 127 |
+
shutil.rmtree(source_path, ignore_errors=True)
|
| 128 |
+
else:
|
| 129 |
+
source_path.unlink(missing_ok=True)
|
| 130 |
+
print(f" ↷ Skipping stale backup entry: {name}")
|
| 131 |
+
continue
|
| 132 |
target_path = OPENCLAW_HOME / name
|
| 133 |
shutil.rmtree(target_path, ignore_errors=True)
|
| 134 |
if target_path.is_file():
|