fix(tui): add update-safe internal-event filter patch scripts

This commit is contained in:
zap
2026-03-04 22:45:05 +00:00
parent 73a5c7c370
commit 7541341e2f
3 changed files with 173 additions and 0 deletions

30
scripts/openclaw-update-safe.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
# Safe updater wrapper:
# 1) runs normal OpenClaw update flow
# 2) re-applies local TUI internal-event filter patch if needed
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PATCH_SCRIPT="$SCRIPT_DIR/openclaw-tui-internal-filter.sh"
if [[ ! -x "$PATCH_SCRIPT" ]]; then
echo "error: missing patch script: $PATCH_SCRIPT" >&2
exit 2
fi
openclaw update "$@"
# Skip patching for purely informational paths
if [[ "${1:-}" == "status" || "${1:-}" == "wizard" || "${1:-}" == "--dry-run" ]]; then
echo "note: update command did not modify install; patch status unchanged."
"$PATCH_SCRIPT" check || true
exit 0
fi
echo "Re-validating TUI internal-event filter patch..."
if "$PATCH_SCRIPT" check; then
echo "patch already present."
else
"$PATCH_SCRIPT" apply
fi