Replace a pre-CSS-format README (the retired `.toml` palette docs) in place so * upgrading users don't read instructions for a format that no longer works. * Leaves an already-current or user-written README untouched.
(dir: string)
| 216 | * upgrading users don't read instructions for a format that no longer works. |
| 217 | * Leaves an already-current or user-written README untouched. */ |
| 218 | async function refreshStaleReadme(dir: string): Promise<void> { |
| 219 | const file = path.join(dir, 'README.md') |
| 220 | try { |
| 221 | const current = await fs.readFile(file, 'utf8') |
| 222 | // Old auto-generated READMEs documented `.toml` palettes and never mention |
| 223 | // manifest.json — the defining word of the folder format. Refresh only those. |
| 224 | if (current !== README && current.includes('.toml') && !current.includes('manifest.json')) { |
| 225 | await fs.writeFile(file, README) |
| 226 | } |
| 227 | } catch { |
| 228 | /* missing or unreadable — respect the user's choice and leave it */ |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | /** Convert each legacy `themes/<slug>.toml` palette to a `themes/<slug>/` folder |
| 233 | * (once). The source is renamed `<slug>.toml.migrated` so it isn't re-read or |
no outgoing calls
no test coverage detected