fix(e2e): bound official installer download (#108937)

* fix(e2e): bound official installer download

* test(e2e): cover downloaded installer execution

* fix(e2e): harden installer download proof

Co-authored-by: Alix-007 <li.long15@xydigit.com>

* test(e2e): type installer fixture environment

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
Alix-007
2026-07-16 20:26:00 +08:00
committed by GitHub
parent 02f494b51e
commit 66a4205c57
3 changed files with 128 additions and 7 deletions
+11 -5
View File
@@ -150,15 +150,21 @@ preinstall_previous_version() {
fi
}
run_official_installer() {
run_official_installer() (
local installer
# time_phase disables errexit, so setup and download failures must return explicitly.
installer="$(mktemp)" || return
trap 'rm -f "$installer"' EXIT
curl -fsSL --connect-timeout 10 --max-time 120 "$INSTALL_URL" -o "$installer" || return
if [[ "$INSTALL_TAG" == "beta" ]]; then
curl -fsSL "$INSTALL_URL" | OPENCLAW_BETA=1 bash
OPENCLAW_BETA=1 bash "$installer"
elif [[ "$INSTALL_TAG" != "latest" ]]; then
curl -fsSL "$INSTALL_URL" | OPENCLAW_VERSION="$INSTALL_TAG" bash
OPENCLAW_VERSION="$INSTALL_TAG" bash "$installer"
else
curl -fsSL "$INSTALL_URL" | bash
bash "$installer"
fi
}
)
verify_installed_version() {
INSTALLED_VERSION="$(openclaw --version 2>/dev/null | head -n 1 | tr -d '\r')"