MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / writeThemeFolder

Function writeThemeFolder

apps/desktop/src/main/custom-themes.ts:170–182  ·  view source on GitHub ↗

Write a theme folder (manifest + theme.css). Overwrites existing files.

(
  dir: string,
  slug: string,
  manifestJson: string,
  css: string
)

Source from the content-addressed store, hash-verified

168
169/** Write a theme folder (manifest + theme.css). Overwrites existing files. */
170async function writeThemeFolder(
171 dir: string,
172 slug: string,
173 manifestJson: string,
174 css: string
175): Promise<void> {
176 const folder = path.join(dir, slug)
177 await fs.mkdir(folder, { recursive: true })
178 await Promise.all([
179 fs.writeFile(path.join(folder, 'manifest.json'), manifestJson),
180 fs.writeFile(path.join(folder, 'theme.css'), css)
181 ])
182}
183
184/** Create the themes dir on first run (seeding Soft Paper + README), and migrate
185 * any leftover `*.toml` palette files from the pre-release WIP. */

Callers 3

ensureCustomThemesDirFunction · 0.85
migrateTomlThemesFunction · 0.85
createCustomThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected