MCPcopy Create free account
hub / github.com/github/awesome-copilot / readExternalPlugins

Function readExternalPlugins

eng/external-plugin-validation.mjs:398–423  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

396}
397
398export function readExternalPlugins(options = {}) {
399 const filePath = options.filePath ?? EXTERNAL_PLUGINS_FILE;
400
401 if (!fs.existsSync(filePath)) {
402 return {
403 plugins: [],
404 errors: [],
405 warnings: [],
406 };
407 }
408
409 let plugins;
410 try {
411 const content = fs.readFileSync(filePath, "utf8");
412 plugins = JSON.parse(content);
413 } catch (error) {
414 return {
415 plugins: [],
416 errors: [`Error reading ${path.basename(filePath)}: ${error.message}`],
417 warnings: [],
418 };
419 }
420
421 const { errors, warnings } = validateExternalPlugins(plugins, options);
422 return { plugins, errors, warnings };
423}

Callers 5

upsertExternalPluginFunction · 0.90
validatePluginsFunction · 0.90
generateMarketplaceFunction · 0.90

Calls 1

validateExternalPluginsFunction · 0.85

Tested by

no test coverage detected