MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getMarketplaceCacheOnly

Function getMarketplaceCacheOnly

src/utils/plugins/marketplaceManager.ts:2081–2107  ·  view source on GitHub ↗
(
  name: string,
)

Source from the content-addressed store, hash-verified

2079 * Use this for startup paths that should never block on network.
2080 */
2081export async function getMarketplaceCacheOnly(
2082 name: string,
2083): Promise<PluginMarketplace | null> {
2084 const fs = getFsImplementation()
2085 const configFile = getKnownMarketplacesFile()
2086
2087 try {
2088 const content = await fs.readFile(configFile, { encoding: 'utf-8' })
2089 const config = jsonParse(content) as KnownMarketplacesConfig
2090 const entry = config[name]
2091
2092 if (!entry) {
2093 return null
2094 }
2095
2096 return await readCachedMarketplace(entry.installLocation)
2097 } catch (error) {
2098 if (isENOENT(error)) {
2099 return null
2100 }
2101 logForDebugging(
2102 `Failed to read cached marketplace ${name}: ${errorMessage(error)}`,
2103 { level: 'warn' },
2104 )
2105 return null
2106 }
2107}
2108
2109/**
2110 * Get a specific marketplace by name

Callers 3

getPluginByIdCacheOnlyFunction · 0.85
installResolvedPluginFunction · 0.85

Calls 8

getFsImplementationFunction · 0.85
getKnownMarketplacesFileFunction · 0.85
jsonParseFunction · 0.85
readCachedMarketplaceFunction · 0.85
isENOENTFunction · 0.85
logForDebuggingFunction · 0.85
readFileMethod · 0.80
errorMessageFunction · 0.50

Tested by

no test coverage detected