MCPcopy
hub / github.com/codeaashu/claude-code / getManagedFileSettingsPresence

Function getManagedFileSettingsPresence

src/utils/settings/settings.ts:127–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125 * Used by /status to show "(file)", "(drop-ins)", or "(file + drop-ins)".
126 */
127export function getManagedFileSettingsPresence(): {
128 hasBase: boolean
129 hasDropIns: boolean
130} {
131 const { settings: base } = parseSettingsFile(getManagedSettingsFilePath())
132 const hasBase = !!base && Object.keys(base).length > 0
133
134 let hasDropIns = false
135 const dropInDir = getManagedSettingsDropInDir()
136 try {
137 hasDropIns = getFsImplementation()
138 .readdirSync(dropInDir)
139 .some(
140 d =>
141 (d.isFile() || d.isSymbolicLink()) &&
142 d.name.endsWith('.json') &&
143 !d.name.startsWith('.'),
144 )
145 } catch {
146 // dir doesn't exist
147 }
148
149 return { hasBase, hasDropIns }
150}
151
152/**
153 * Handles file system errors appropriately

Callers 1

Calls 4

parseSettingsFileFunction · 0.85
getFsImplementationFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected