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

Function readConfigFile

apps/desktop/src/main/app-config.ts:535–552  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

533const WATCH_DEBOUNCE_MS = 150
534
535async function readConfigFile(): Promise<{ text: string; portable: AppConfigPortable } | null> {
536 const file = getConfigFilePath()
537 let text: string
538 try {
539 text = await fs.readFile(file, 'utf8')
540 } catch (err) {
541 if (isMissingFileError(err)) return null
542 console.warn('Failed to read config.toml', err)
543 return null
544 }
545 try {
546 const { portable } = deserializeConfig(text)
547 return { text, portable }
548 } catch (err) {
549 console.warn('Failed to parse config.toml — keeping last good config', err)
550 return null
551 }
552}
553
554function debounce<Args extends unknown[]>(
555 fn: (...args: Args) => void,

Callers 2

startWatchingFunction · 0.70
initAppConfigFunction · 0.70

Calls 3

getConfigFilePathFunction · 0.85
deserializeConfigFunction · 0.85
isMissingFileErrorFunction · 0.70

Tested by

no test coverage detected