()
| 68 | } |
| 69 | |
| 70 | function main() { |
| 71 | const args = parseArgs(process.argv); |
| 72 | if (args.help) { |
| 73 | process.stdout.write(`${usage()}\n`); |
| 74 | return; |
| 75 | } |
| 76 | |
| 77 | const report = verifyProjectTelemetry(args.projectRoot, { |
| 78 | files: args.files, |
| 79 | }); |
| 80 | const pass = report.totals.tampered === 0 && |
| 81 | report.totals.invalid === 0 && |
| 82 | (!args.strictLegacy || report.totals.legacy === 0); |
| 83 | |
| 84 | if (args.json) { |
| 85 | process.stdout.write(`${JSON.stringify({ ...report, pass }, null, 2)}\n`); |
| 86 | } else { |
| 87 | process.stdout.write(render(report)); |
| 88 | } |
| 89 | |
| 90 | process.exitCode = pass ? 0 : 1; |
| 91 | } |
| 92 | |
| 93 | if (require.main === module) { |
| 94 | main(); |
no test coverage detected