(pluginsCacheDir: string)
| 15 | ]; |
| 16 | |
| 17 | async 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 | |
| 36 | function getBaseDir(scope: InstallScope, projectPath: string): string { |
| 37 | return scope === 'global' ? os.homedir() : projectPath; |
no test coverage detected