(source: SettingSource)
| 237 | * @returns The root path of the settings file |
| 238 | */ |
| 239 | export 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. |
no test coverage detected