()
| 218 | } |
| 219 | |
| 220 | function getPluginCacheInfo(): { path: string; cached?: string; latest?: string } { |
| 221 | const [path = ""] = getOpenCodePluginCacheRoots(); |
| 222 | let cached: string | undefined; |
| 223 | for (const installedPkgPath of getOpenCodePluginPackageJsonPaths()) { |
| 224 | try { |
| 225 | if (existsSync(installedPkgPath)) { |
| 226 | const pkg = JSON.parse(readFileSync(installedPkgPath, "utf-8")) as { |
| 227 | version?: unknown; |
| 228 | }; |
| 229 | cached = typeof pkg.version === "string" ? pkg.version : undefined; |
| 230 | if (cached) break; |
| 231 | } |
| 232 | } catch { |
| 233 | cached = undefined; |
| 234 | } |
| 235 | } |
| 236 | return { path, cached, latest: getSelfVersion() }; |
| 237 | } |
| 238 | |
| 239 | function getStorageDir(): string { |
| 240 | const dataHome = process.env.XDG_DATA_HOME || join(homedir(), ".local", "share"); |
no test coverage detected