mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 05:30:21 +00:00
refactor(scripts): share guard runners and paged select UI
This commit is contained in:
13
scripts/lib/pairing-guard-context.mjs
Normal file
13
scripts/lib/pairing-guard-context.mjs
Normal file
@@ -0,0 +1,13 @@
|
||||
import path from "node:path";
|
||||
import { resolveRepoRoot, resolveSourceRoots } from "./ts-guard-utils.mjs";
|
||||
|
||||
export function createPairingGuardContext(importMetaUrl) {
|
||||
const repoRoot = resolveRepoRoot(importMetaUrl);
|
||||
const sourceRoots = resolveSourceRoots(repoRoot, ["src", "extensions"]);
|
||||
return {
|
||||
repoRoot,
|
||||
sourceRoots,
|
||||
resolveFromRepo: (relativePath) =>
|
||||
path.join(repoRoot, ...relativePath.split("/").filter(Boolean)),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user