()
| 81 | } |
| 82 | |
| 83 | async function main() { |
| 84 | const args = parseArgs(process.argv.slice(2)); |
| 85 | if (args.help) { |
| 86 | usage(); |
| 87 | return; |
| 88 | } |
| 89 | if (!args.out) { |
| 90 | usage(); |
| 91 | process.exit(2); |
| 92 | } |
| 93 | |
| 94 | const [workflows, tools, pkg] = await Promise.all([ |
| 95 | loadYamlDir(path.join(repoRoot, "manifests", "workflows")), |
| 96 | loadYamlDir(path.join(repoRoot, "manifests", "tools")), |
| 97 | readFile(path.join(repoRoot, "package.json"), "utf8").then(JSON.parse), |
| 98 | ]); |
| 99 | |
| 100 | const ref = args.ref ?? `v${pkg.version}`; |
| 101 | const snapshot = { |
| 102 | source: `github:getsentry/XcodeBuildMCP@${ref}`, |
| 103 | ref, |
| 104 | syncedAt: new Date().toISOString(), |
| 105 | version: pkg.version, |
| 106 | workflows: normalizeWorkflows(workflows), |
| 107 | tools: normalizeTools(tools), |
| 108 | }; |
| 109 | |
| 110 | const outPath = path.resolve(args.out); |
| 111 | await mkdir(path.dirname(outPath), { recursive: true }); |
| 112 | await writeFile(outPath, JSON.stringify(snapshot, null, 2) + "\n", "utf8"); |
| 113 | |
| 114 | console.log( |
| 115 | `Wrote ${outPath}\n ref: ${ref}\n version: ${snapshot.version}\n workflows: ${snapshot.workflows.length}\n tools: ${snapshot.tools.length}`, |
| 116 | ); |
| 117 | } |
| 118 | |
| 119 | main().catch((err) => { |
| 120 | console.error(err); |
no test coverage detected