fix(tui): add update-safe internal-event filter patch scripts
This commit is contained in:
30
scripts/openclaw-update-safe.sh
Executable file
30
scripts/openclaw-update-safe.sh
Executable 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
|
||||
Reference in New Issue
Block a user