()
| 64 | } |
| 65 | |
| 66 | async 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 | |
| 92 | if (isMain()) { |
| 93 | main().catch((err) => { |
no test coverage detected
searching dependent graphs…