MCPcopy Create free account
hub / github.com/Noumena-Network/code / readMarketplaceJsonContent

Function readMarketplaceJsonContent

src/utils/plugins/zipCacheAdapters.ts:120–134  ·  view source on GitHub ↗

* Read marketplace.json content from a cloned marketplace directory or file. * For directory sources: checks .claude-plugin/marketplace.json, marketplace.json * For URL sources: the installLocation IS the marketplace JSON file itself.

(dir: string)

Source from the content-addressed store, hash-verified

118 * For URL sources: the installLocation IS the marketplace JSON file itself.
119 */
120async function readMarketplaceJsonContent(dir: string): Promise<string | null> {
121 const candidates = [
122 join(dir, '.claude-plugin', 'marketplace.json'),
123 join(dir, 'marketplace.json'),
124 dir, // For URL sources, installLocation IS the marketplace JSON file
125 ]
126 for (const candidate of candidates) {
127 try {
128 return await readFile(candidate, 'utf-8')
129 } catch {
130 // ENOENT (doesn't exist) or EISDIR (directory) — try next
131 }
132 }
133 return null
134}
135
136/**
137 * Sync marketplace data to zip cache for offline access.

Callers 1

Calls 1

readFileFunction · 0.85

Tested by

no test coverage detected