(entry: RegistryEntry)
| 140 | } |
| 141 | |
| 142 | function 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 | |
| 155 | function migrateLegacyRegistryIfNeeded(): void { |
| 156 | if (migrationChecked) { |
no test coverage detected