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.
()
| 100 | // Intentionally used only by read-only commands (e.g. ocr llm test). Write paths such as |
| 101 | // config set and review keep defaultConfigPath() so a leaked OCR_CONFIG_PATH cannot redirect writes. |
| 102 | func resolveConfigPath() (string, error) { |
| 103 | if p := strings.TrimSpace(os.Getenv("OCR_CONFIG_PATH")); p != "" { |
| 104 | return p, nil |
| 105 | } |
| 106 | return defaultConfigPath() |
| 107 | } |
| 108 | |
| 109 | func runConfigSet(key, value string) error { |
| 110 | configPath, err := defaultConfigPath() |