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

Function resolveConfigPath

cmd/opencodereview/config_cmd.go:102–107  ·  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

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.
102func resolveConfigPath() (string, error) {
103 if p := strings.TrimSpace(os.Getenv("OCR_CONFIG_PATH")); p != "" {
104 return p, nil
105 }
106 return defaultConfigPath()
107}
108
109func runConfigSet(key, value string) error {
110 configPath, err := defaultConfigPath()

Callers 3

runLLMTestFunction · 0.85

Calls 1

defaultConfigPathFunction · 0.85

Tested by 2