Skip to content

Commit 1c4e65c

Browse files
aaajiaoclaude
andcommitted
fix: run hash migration before early exit check
The migration from monolithic .sandbox-build-hash to per-image hashes was placed after the "already on latest version" early exit, so it never ran for users already up to date. Move it before the check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fbec3ca commit 1c4e65c

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

scripts/commands/update.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ if [ -z "$LATEST_TAG" ]; then
5959
fi
6060
echo " -> $LATEST_TAG"
6161

62+
# --- Migrate old single hash → per-image hashes (no rebuild) ---
63+
orb -m "$OPENCLAW_VM_NAME" bash -lc '
64+
if [ -f ~/.openclaw/.sandbox-build-hash ] && [ ! -f ~/.openclaw/.sandbox-hash-base ]; then
65+
cd ~/openclaw
66+
cat Dockerfile.sandbox scripts/sandbox-setup.sh 2>/dev/null | sha256sum | cut -c1-64 > ~/.openclaw/.sandbox-hash-base
67+
cat Dockerfile.sandbox-common scripts/sandbox-common-setup.sh 2>/dev/null | sha256sum | cut -c1-64 > ~/.openclaw/.sandbox-hash-common
68+
cat Dockerfile.sandbox-browser scripts/sandbox-browser-setup.sh 2>/dev/null | sha256sum | cut -c1-64 > ~/.openclaw/.sandbox-hash-browser
69+
rm -f ~/.openclaw/.sandbox-build-hash
70+
fi
71+
' 2>/dev/null || true
72+
6273
# Check if already on the latest tag
6374
CURRENT_HEAD=$(orb -m "$OPENCLAW_VM_NAME" bash -lc "cd ~/openclaw && git rev-parse HEAD 2>/dev/null")
6475
TAG_COMMIT=$(orb -m "$OPENCLAW_VM_NAME" bash -lc "cd ~/openclaw && git rev-parse '$LATEST_TAG^{commit}' 2>/dev/null")
@@ -103,17 +114,6 @@ orb -m "$OPENCLAW_VM_NAME" bash -lc "cd ~/openclaw && pnpm ui:build"
103114
echo "$MSG_CMD_UPDATE_REINSTALL"
104115
orb -m "$OPENCLAW_VM_NAME" bash -lc "cd ~/openclaw && sudo npm install -g ."
105116

106-
# --- Migrate old single hash → per-image hashes (no rebuild) ---
107-
orb -m "$OPENCLAW_VM_NAME" bash -lc '
108-
if [ -f ~/.openclaw/.sandbox-build-hash ] && [ ! -f ~/.openclaw/.sandbox-hash-base ]; then
109-
cd ~/openclaw
110-
cat Dockerfile.sandbox scripts/sandbox-setup.sh 2>/dev/null | sha256sum | cut -c1-64 > ~/.openclaw/.sandbox-hash-base
111-
cat Dockerfile.sandbox-common scripts/sandbox-common-setup.sh 2>/dev/null | sha256sum | cut -c1-64 > ~/.openclaw/.sandbox-hash-common
112-
cat Dockerfile.sandbox-browser scripts/sandbox-browser-setup.sh 2>/dev/null | sha256sum | cut -c1-64 > ~/.openclaw/.sandbox-hash-browser
113-
rm -f ~/.openclaw/.sandbox-build-hash
114-
fi
115-
' 2>/dev/null || true
116-
117117
# --- Per-image sandbox hash detection ---
118118
BUILD_BASE=false
119119
BUILD_COMMON=false

0 commit comments

Comments
 (0)