MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / runJsonExport

Function runJsonExport

apps/docs/scripts/docs-catalog-lib.mjs:38–63  ·  view source on GitHub ↗
(cwd, command, args)

Source from the content-addressed store, hash-verified

36const JSON_EXPORT_TIMEOUT_MS = 60_000;
37
38function runJsonExport(cwd, command, args) {
39 let stdout;
40
41 try {
42 stdout = execFileSync(command, args, {
43 cwd,
44 encoding: "utf8",
45 stdio: ["ignore", "pipe", "pipe"],
46 timeout: JSON_EXPORT_TIMEOUT_MS,
47 });
48 } catch (error) {
49 const stderr =
50 error !== null && typeof error === "object" && "stderr" in error
51 ? String(error.stderr ?? "").trim()
52 : "";
53 const reason = error instanceof Error ? error.message : String(error);
54
55 throw new Error(
56 `[docs] ${command} ${args.join(" ")} failed in ${cwd}: ${reason}${
57 stderr === "" ? "" : `\n--- child stderr ---\n${stderr}`
58 }`
59 );
60 }
61
62 return JSON.parse(stdout);
63}
64
65export function buildLintMetaCatalog() {
66 const uiRoot = resolveTemplateRoot("BORINGSTACK_UI_DIR", "ui");

Callers 1

buildLintMetaCatalogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected