From 2c43c441b252ec1e80fa5ea975e4b16e37d7a372 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 17 Apr 2026 19:34:01 +0100 Subject: [PATCH] test: source minimal install helper fixture --- src/install-sh-version.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/install-sh-version.test.ts b/src/install-sh-version.test.ts index 9eb60242bcd..c2e627ed901 100644 --- a/src/install-sh-version.test.ts +++ b/src/install-sh-version.test.ts @@ -28,6 +28,12 @@ function resolveInstallerVersionCases(params: { }): string[] { const installerPath = path.join(process.cwd(), "scripts", "install.sh"); const installerSource = fs.readFileSync(installerPath, "utf-8"); + const versionHelperStart = installerSource.indexOf("load_install_version_helpers() {"); + const versionHelperEnd = installerSource.indexOf("\nis_gateway_daemon_loaded() {"); + if (versionHelperStart < 0 || versionHelperEnd < 0) { + throw new Error("install.sh version helper block not found"); + } + const versionHelperSource = installerSource.slice(versionHelperStart, versionHelperEnd); const output = execFileSync( "bash", [ @@ -40,7 +46,7 @@ done ( cd "$2" FAKE_OPENCLAW_BIN="\${@:1:1}" bash -s <<'OPENCLAW_STDIN_INSTALLER' -${installerSource} +${versionHelperSource} OPENCLAW_BIN="$FAKE_OPENCLAW_BIN" resolve_openclaw_version OPENCLAW_STDIN_INSTALLER