fix(felhom-wipe): nuclear wipe stops early due to set -e + missing state files

[ -f "$f" ] && rm -f "$f" && info "..." returns exit code 1 when the
file doesn't exist, triggering set -euo pipefail. Nuclear wipe was
silently stopping after settings.json and metrics.db (the only two
state files present), never reaching the controller/full/nuclear steps.

Fix: if [ -f "$f" ]; then rm -f "$f" && info "..."; fi

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 12:03:56 +01:00
parent 49b3611f39
commit a2848f6d67
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -346,7 +346,7 @@ do_soft_wipe() {
info "Soft wipe: removing controller state..."
local state_files=("$DATA_DIR/settings.json" "$DATA_DIR/metrics.db" "$DATA_DIR/setup-state.json" "$DATA_DIR/update-state.json" "$DATA_DIR/session-data.json" "$DATA_DIR/snapshot-history.json")
for f in "${state_files[@]}"; do
[ -f "$f" ] && rm -f "$f" && info " Removed: $f"
if [ -f "$f" ]; then rm -f "$f" && info " Removed: $f"; fi
done
}