MCPcopy Create free account
hub / github.com/alibaba/open-code-review / resolveConfigPath

Function resolveConfigPath

cmd/opencodereview/config_cmd.go:95–100  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

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.
95func resolveConfigPath() (string, error) {
96 if p := strings.TrimSpace(os.Getenv("OCR_CONFIG_PATH")); p != "" {
97 return p, nil
98 }
99 return defaultConfigPath()
100}
101
102func runConfigSet(key, value string) error {
103 configPath, err := defaultConfigPath()

Callers 3

runLLMTestFunction · 0.85

Calls 1

defaultConfigPathFunction · 0.85

Tested by 2