openclaw/scripts/crabbox-setup.mts
Peter Steinberger bb3b67a5b0
fix(crabbox): reuse managed CLI across QA and remote proof (#144154)
* refactor(crabbox): centralize CLI discovery and setup

Reuse plugin-owned binary admission in QA Lab and workflow setup, carry verified versions through proof tooling, and preserve caller environments. Follow-up to #143768.

* fix(crabbox): preserve QA executable working directory
2026-09-10 09:57:28 -07:00

19 lines
675 B
TypeScript

import { appendFile } from "node:fs/promises";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import {
ensureManagedCrabboxBinary,
resolveCrabboxBinary,
} from "../extensions/crabbox/cli-runtime-api.js";
import { resolvePathEnvKey } from "./windows-cmd-helpers.mjs";
const cli = await ensureManagedCrabboxBinary({
binary: resolveCrabboxBinary({
openclawRoot: resolve(dirname(fileURLToPath(import.meta.url)), ".."),
pathEnv: process.env[resolvePathEnvKey(process.env)],
}),
});
if (process.env.GITHUB_PATH) {
await appendFile(process.env.GITHUB_PATH, `${dirname(cli.binary)}\n`);
}
console.log(JSON.stringify(cli));