MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / hydrateEntries

Function hydrateEntries

scripts/codex-worktree-cache.mjs:55–73  ·  view source on GitHub ↗
(entries)

Source from the content-addressed store, hash-verified

53}
54
55function hydrateEntries(entries) {
56 const sourceRoots = cacheSourceRoots();
57 for (const entry of entries) {
58 const destination = join(ROOT, entry.destination);
59 if (existsAndHasContent(destination) && !force) {
60 log(`skip ${entry.label}; ${entry.destination} already exists`);
61 continue;
62 }
63
64 const source = findHydrationSource(entry, sourceRoots);
65 if (!source) {
66 log(`miss ${entry.label}`);
67 continue;
68 }
69
70 copyIntoPlace(source.path, destination);
71 log(`hydrated ${entry.label} from ${source.description}`);
72 }
73}
74
75function saveEntries(entries) {
76 mkdirSync(CACHE_ROOT, { recursive: true });

Callers 1

Calls 5

cacheSourceRootsFunction · 0.85
logFunction · 0.85
findHydrationSourceFunction · 0.85
copyIntoPlaceFunction · 0.85
existsAndHasContentFunction · 0.70

Tested by

no test coverage detected