MCPcopy
hub / github.com/entropic-dev/entropic / main

Function main

tools/vcpm-sync/main.js:172–202  ·  view source on GitHub ↗
({
  token,
  _: [pkg],
  recursive = false,
  __seen = new Set()
})

Source from the content-addressed store, hash-verified

170}
171
172async function main({
173 token,
174 _: [pkg],
175 recursive = false,
176 __seen = new Set()
177}) {
178 if (__seen.has(pkg)) {
179 return;
180 }
181
182 __seen.add(pkg);
183 if (!token) {
184 console.error('Must provide bearer token using --token=ent_v1_abbab...');
185 return 1;
186 }
187
188 if (!pkg) {
189 console.error('Must provide package name');
190 return 1;
191 }
192
193 const deps = await syncPackage(token, pkg, message => {
194 console.log(message);
195 });
196
197 if (recursive) {
198 for (const dep of deps) {
199 await main({ token, _: [dep], recursive, __seen });
200 }
201 }
202}
203
204if (require.main === module) {
205 main(minimist(process.argv.slice(2)))

Callers 1

main.jsFile · 0.70

Calls 5

syncPackageFunction · 0.85
hasMethod · 0.80
addMethod · 0.45
errorMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected