resolveConfigPath returns OCR_CONFIG_PATH when set, otherwise the default user config path. Intentionally used only by read-only commands (e.g. ocr llm test). Write paths such as config set and review keep defaultConfigPath() so a leaked OCR_CONFIG_PATH cannot redirect writes.
()
| 93 | // Intentionally used only by read-only commands (e.g. ocr llm test). Write paths such as |
| 94 | // config set and review keep defaultConfigPath() so a leaked OCR_CONFIG_PATH cannot redirect writes. |
| 95 | func resolveConfigPath() (string, error) { |
| 96 | if p := strings.TrimSpace(os.Getenv("OCR_CONFIG_PATH")); p != "" { |
| 97 | return p, nil |
| 98 | } |
| 99 | return defaultConfigPath() |
| 100 | } |
| 101 | |
| 102 | func runConfigSet(key, value string) error { |
| 103 | configPath, err := defaultConfigPath() |