MCPcopy
hub / github.com/rpamis/comet / hasSuperpowersInPluginCache

Function hasSuperpowersInPluginCache

src/core/detect.ts:17–34  ·  view source on GitHub ↗
(pluginsCacheDir: string)

Source from the content-addressed store, hash-verified

15];
16
17async function hasSuperpowersInPluginCache(pluginsCacheDir: string): Promise<boolean> {
18 const marketplaceEntries = await readDir(pluginsCacheDir);
19 for (const marketplace of marketplaceEntries) {
20 const superpowersDir = path.join(pluginsCacheDir, marketplace, 'superpowers');
21 if (!(await fileExists(superpowersDir))) continue;
22
23 const versionEntries = await readDir(superpowersDir);
24 for (const version of versionEntries) {
25 const skillsDir = path.join(superpowersDir, version, 'skills');
26 const skills = await readDir(skillsDir);
27 if (SUPERPOWERS_SKILLS.some((name) => skills.includes(name))) {
28 return true;
29 }
30 }
31 }
32
33 return false;
34}
35
36function getBaseDir(scope: InstallScope, projectPath: string): string {
37 return scope === 'global' ? os.homedir() : projectPath;

Callers 2

hasPluginSuperpowersFunction · 0.85

Calls 2

readDirFunction · 0.85
fileExistsFunction · 0.50

Tested by

no test coverage detected