MCPcopy
hub / github.com/cloudflare/capnweb / main

Function main

packages/capnweb-validate/src/cli.ts:66–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64}
65
66async function main(): Promise<void> {
67 let [command, ...rest] = process.argv.slice(2);
68 if (command === undefined || command === "--help" || command === "-h") {
69 usage(command === undefined ? 1 : 0);
70 }
71 if (command !== "build") {
72 throw new Error(`Unknown command: ${command}. Run with --help for usage.`);
73 }
74 let opts = parseBuildArgs(rest);
75 if (!opts.out) {
76 throw new Error(
77 "Missing --out <dir>. Specify where to write transformed sources.");
78 }
79 let result = await runBuild({
80 out: opts.out,
81 tsconfig: opts.tsconfig,
82 cwd: opts.cwd,
83 serverValidation: opts.serverValidation,
84 });
85 console.log(
86 `capnweb-validate: ${result.transformed} transformed, ` +
87 `${result.copied} copied` +
88 (result.skipped ? `, ${result.skipped} skipped (outside project)` : "") +
89 ` -> ${opts.out}`);
90}
91
92if (isMain()) {
93 main().catch((err) => {

Callers 1

cli.tsFile · 0.70

Calls 3

usageFunction · 0.85
parseBuildArgsFunction · 0.85
runBuildFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…