MCPcopy
hub / github.com/Fission-AI/OpenSpec / ensureCliBuilt

Function ensureCliBuilt

test/helpers/run-cli.ts:56–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54}
55
56export async function ensureCliBuilt() {
57 if (existsSync(cliEntry)) {
58 return;
59 }
60
61 if (!buildPromise) {
62 buildPromise = runCommand('pnpm', ['run', 'build']).catch((error) => {
63 buildPromise = undefined;
64 throw error;
65 });
66 }
67
68 await buildPromise;
69
70 if (!existsSync(cliEntry)) {
71 throw new Error('CLI entry point missing after build. Expected dist/cli/index.js');
72 }
73}
74
75export async function runCLI(args: string[] = [], options: RunCLIOptions = {}): Promise<RunCLIResult> {
76 await ensureCliBuilt();

Callers 2

setupFunction · 0.85
runCLIFunction · 0.85

Calls 1

runCommandFunction · 0.85

Tested by

no test coverage detected