Add hs_* temp cleanup at START of sync (before Step 0)

This commit is contained in:
2026-04-20 20:15:51 +09:00
parent 095f02fc59
commit 88c89ab9c1

13
sync.sh
View File

@@ -1,4 +1,17 @@
#!/bin/bash
# ── Step 0.5: Clean stale temp directories from previous runs ────────────
python3 << 'CLEANUP'
import shutil, glob, os
for prefix in ['hs_merge_', 'hs_exp_', 'hs_rest_']:
for d in glob.glob(os.path.join('/tmp', prefix + '*')):
try:
shutil.rmtree(d)
print(f'Cleaned: {d}')
except Exception as e:
print(f'Failed to clean {d}: {e}')
CLEANUP
set -e
SYNC_DIR="${SYNC_DIR:-$HOME/.hermes-sync}"