()
| 124 | * @returns The cached changelog content or empty string if not available |
| 125 | */ |
| 126 | export async function getStoredChangelog(): Promise<string> { |
| 127 | if (changelogMemoryCache !== null) { |
| 128 | return changelogMemoryCache |
| 129 | } |
| 130 | const cachePath = getChangelogCachePath() |
| 131 | try { |
| 132 | const content = await readFile(cachePath, 'utf-8') |
| 133 | changelogMemoryCache = content |
| 134 | return content |
| 135 | } catch { |
| 136 | changelogMemoryCache = '' |
| 137 | return '' |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * Synchronous accessor for the changelog, reading only from the in-memory cache. |
no test coverage detected