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

Function ensureOverridesDir

apps/desktop/src/main/overrides.ts:103–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101
102/** Create the overrides dir on first run, seeding an example + README. */
103export async function ensureOverridesDir(): Promise<string> {
104 const dir = getOverridesDir()
105 let existed = true
106 try {
107 await fs.access(dir)
108 } catch {
109 existed = false
110 }
111 await fs.mkdir(dir, { recursive: true })
112 if (!existed) {
113 await Promise.all([
114 fs.writeFile(path.join(dir, 'example.css'), EXAMPLE).catch(() => {}),
115 fs.writeFile(path.join(dir, 'README.md'), README).catch(() => {})
116 ])
117 }
118 return dir
119}
120
121/** Read every `*.css` in the overrides dir into a Override (raw text). */
122export async function listOverrides(): Promise<Override[]> {

Callers 3

index.tsFile · 0.90
overrides.test.tsFile · 0.90
overrideRevealTargetFunction · 0.85

Calls 1

getOverridesDirFunction · 0.85

Tested by

no test coverage detected