MCPcopy Index your code
hub / github.com/code-forge-io/react-router-devtools / run

Function run

docs/scripts/generate-docs.ts:11–26  ·  view source on GitHub ↗
(cmd: string, opts: RunOpts = {})

Source from the content-addressed store, hash-verified

9
10type RunOpts = { cwd?: string; inherit?: boolean };
11function run(cmd: string, opts: RunOpts = {}) {
12 const exOpts: ExecSyncOptions = {
13 cwd: opts.cwd,
14 stdio: opts.inherit ? "inherit" : "pipe",
15 encoding: "utf8",
16 };
17 try {
18 const res = execSync(cmd, exOpts);
19 if (opts.inherit) return "";
20 if (typeof res === "string") return res.trim();
21 return (res?.toString?.("utf8") ?? "").trim();
22 } catch (err: unknown) {
23 const msg = err instanceof Error ? err.message : String(err);
24 throw new Error(`Command failed: ${cmd}\n${msg}`);
25 }
26}
27
28const ensureDir = (p: string) => mkdirSync(p, { recursive: true });
29const resetDir = (p: string) => { if (existsSync(p)) rmSync(p, { recursive: true, force: true }); ensureDir(p); };

Callers 8

generate-docs.tsFile · 0.85
allTagsFunction · 0.85
detectDefaultBranchFunction · 0.85
hasLocalRefFunction · 0.85
refHasPathFunction · 0.85
buildDocsFunction · 0.85
buildRefFunction · 0.85
buildBranchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected