mirror of
https://github.com/openclaw/openclaw.git
synced 2026-09-11 19:10:24 +00:00
* 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
19 lines
675 B
TypeScript
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));
|