MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / makeHashDir

Function makeHashDir

apps/kimi-code/test/native/cache-gc.test.ts:20–27  ·  view source on GitHub ↗
(version: string, target: string, hash: string, mtimeOffset = 0)

Source from the content-addressed store, hash-verified

18 });
19
20 function makeHashDir(version: string, target: string, hash: string, mtimeOffset = 0): string {
21 const dir = join(root, 'native', version, target, hash);
22 mkdirSync(dir, { recursive: true });
23 writeFileSync(join(dir, 'marker.txt'), hash);
24 const now = Math.floor(Date.now() / 1000);
25 utimesSync(dir, now + mtimeOffset, now + mtimeOffset);
26 return dir;
27 }
28
29 it('keeps currentRoot + most recently modified sibling, deletes the rest', () => {
30 const v = '1.0.0';

Callers 1

cache-gc.test.tsFile · 0.85

Calls 1

nowMethod · 0.65

Tested by

no test coverage detected