MCPcopy Create free account
hub / github.com/alibaba/open-code-review / main

Function main

scripts/github-actions/check-plugin-contract.js:1108–1120  ·  view source on GitHub ↗
(argv = process.argv.slice(2), env = process.env)

Source from the content-addressed store, hash-verified

1106}
1107
1108function main(argv = process.argv.slice(2), env = process.env) {
1109 const mode = (argv[0] || "all").toLowerCase();
1110 const repoRoot = env.OCR_REPO_ROOT || process.cwd();
1111 if (mode === "links" || mode === "link") return runLinksCheck({ repoRoot });
1112 if (mode === "manifests" || mode === "manifest") return runManifestsCheck({ repoRoot });
1113 if (mode === "all") {
1114 const a = runLinksCheck({ repoRoot });
1115 const b = runManifestsCheck({ repoRoot });
1116 return a || b;
1117 }
1118 emitError(null, `Unknown mode "${mode}". Use "links", "manifests", or "all".`);
1119 return 2;
1120}
1121
1122if (require.main === module) {
1123 process.exit(main());

Callers 1

Calls 3

runLinksCheckFunction · 0.85
runManifestsCheckFunction · 0.85
emitErrorFunction · 0.70

Tested by

no test coverage detected