MCPcopy Index your code
hub / github.com/lingodotdev/lingo.dev / getProgram

Function getProgram

scripts/docs/src/generate-cli-docs.ts:29–48  ·  view source on GitHub ↗
(repoRoot: string)

Source from the content-addressed store, hash-verified

27const FRONTMATTER_DELIMITER = "---";
28
29async function getProgram(repoRoot: string): Promise<Command> {
30 const filePath = resolve(
31 repoRoot,
32 "packages",
33 "cli",
34 "src",
35 "cli",
36 "index.ts",
37 );
38
39 if (!existsSync(filePath)) {
40 throw new Error(`CLI source file not found at ${filePath}`);
41 }
42
43 const cliModule = (await import(pathToFileURL(filePath).href)) as {
44 default: Command;
45 };
46
47 return cliModule.default;
48}
49
50function slugifyCommandName(name: string): string {
51 const slug = name

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected