MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / writeCache

Function writeCache

src/utils/updateCheck.ts:91–103  ·  view source on GitHub ↗
(latest: string | null)

Source from the content-addressed store, hash-verified

89}
90
91function writeCache(latest: string | null): void {
92 try {
93 const dir = getConfigDir();
94 fs.mkdirSync(dir, { recursive: true });
95 fs.writeFileSync(
96 getCachePath(),
97 JSON.stringify({ checkedAt: Date.now(), latest } satisfies CachedCheck),
98 { mode: 0o600 },
99 );
100 } catch {
101 // best-effort; a missing cache just means we'll hit the registry again next launch
102 }
103}
104
105export interface UpdateInfo {
106 current: string;

Callers 1

getUpdateInfoFunction · 0.85

Calls 2

getConfigDirFunction · 0.85
getCachePathFunction · 0.85

Tested by

no test coverage detected