(gitUser: string | null)
| 205 | * Reads config.json fresh each call so the response reflects the latest file on disk. |
| 206 | */ |
| 207 | export function getServerConfig(gitUser: string | null): { |
| 208 | displayName?: string; |
| 209 | diffOptions?: DiffOptions; |
| 210 | gitUser?: string; |
| 211 | conventionalComments?: boolean; |
| 212 | conventionalLabels?: CCLabelConfig[] | null; |
| 213 | } { |
| 214 | const cfg = loadConfig(); |
| 215 | return { |
| 216 | displayName: cfg.displayName, |
| 217 | diffOptions: cfg.diffOptions, |
| 218 | gitUser: gitUser ?? undefined, |
| 219 | ...(cfg.conventionalComments !== undefined && { conventionalComments: cfg.conventionalComments }), |
| 220 | ...(cfg.conventionalLabels !== undefined && { conventionalLabels: cfg.conventionalLabels }), |
| 221 | }; |
| 222 | } |
| 223 | |
| 224 | /** |
| 225 | * Read the user's preferred default diff type from config, falling back to 'unstaged'. |
no test coverage detected