mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:50:43 +00:00
test: source minimal install helper fixture
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user