()
| 36 | * validation (data comes from a shared mounted volume — other containers may write). |
| 37 | */ |
| 38 | export async function readZipCacheKnownMarketplaces(): Promise<KnownMarketplacesFile> { |
| 39 | try { |
| 40 | const content = await readFile(getZipCacheKnownMarketplacesPath(), 'utf-8') |
| 41 | const parsed = KnownMarketplacesFileSchema().safeParse(jsonParse(content)) |
| 42 | if (!parsed.success) { |
| 43 | logForDebugging( |
| 44 | `Invalid known_marketplaces.json in zip cache: ${parsed.error.message}`, |
| 45 | { level: 'error' }, |
| 46 | ) |
| 47 | return {} |
| 48 | } |
| 49 | return parsed.data |
| 50 | } catch { |
| 51 | return {} |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Write known_marketplaces.json to the zip cache atomically. |
no test coverage detected