MCPcopy
hub / github.com/claude-code-best/claude-code / getSettingsRootPathForSource

Function getSettingsRootPathForSource

src/utils/settings/settings.ts:239–253  ·  view source on GitHub ↗
(source: SettingSource)

Source from the content-addressed store, hash-verified

237 * @returns The root path of the settings file
238 */
239export function getSettingsRootPathForSource(source: SettingSource): string {
240 switch (source) {
241 case 'userSettings':
242 return resolve(getClaudeConfigHomeDir())
243 case 'policySettings':
244 case 'projectSettings':
245 case 'localSettings': {
246 return resolve(getOriginalCwd())
247 }
248 case 'flagSettings': {
249 const path = getFlagSettingsPath()
250 return path ? dirname(resolve(path)) : resolve(getOriginalCwd())
251 }
252 }
253}
254
255/**
256 * Get the user settings filename based on cowork mode.

Callers 4

rootPathForSourceFunction · 0.85

Calls 3

getOriginalCwdFunction · 0.85
getFlagSettingsPathFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected