MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / writeEntryFile

Function writeEntryFile

src/runtime/registry.ts:142–153  ·  view source on GitHub ↗
(entry: RegistryEntry)

Source from the content-addressed store, hash-verified

140}
141
142function writeEntryFile(entry: RegistryEntry): void {
143 ensureRegistryReady();
144 const normalized: RegistryEntry = {
145 ...entry,
146 dir: canonicalizeDir(entry.dir),
147 updatedAt: entry.updatedAt ?? new Date().toISOString(),
148 };
149 const entryPath = getEntryPathForCanonicalDir(normalized.dir);
150 const tmpPath = createTmpPath(entryPath);
151 fs.writeFileSync(tmpPath, JSON.stringify(normalized, null, 2), "utf-8");
152 fs.renameSync(tmpPath, entryPath);
153}
154
155function migrateLegacyRegistryIfNeeded(): void {
156 if (migrationChecked) {

Callers 6

writeEntryFunction · 0.85
writeRegistryFunction · 0.85
registerFunction · 0.85
deregisterFunction · 0.85
validateEntriesFunction · 0.85

Calls 4

ensureRegistryReadyFunction · 0.85
canonicalizeDirFunction · 0.85
createTmpPathFunction · 0.85

Tested by

no test coverage detected