MCPcopy Index your code
hub / github.com/LunaSource/Luna / LoadProjectConfig

Function LoadProjectConfig

config/loader.go:44–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42}
43
44func LoadProjectConfig() Config {
45 path := filepath.Join(".", PROJECT_CONFIG_FILE)
46 if _, err := os.Stat(path); os.IsNotExist(err) {
47 return GetDefaultConfig()
48 }
49
50 data, err := ioutil.ReadFile(path)
51 if err != nil {
52 return GetDefaultConfig()
53 }
54
55 var cfg Config
56 if err := json.Unmarshal(data, &cfg); err != nil {
57 return GetDefaultConfig()
58 }
59 return cfg
60}
61
62func SaveGlobalConfig(cfg Config) error {
63 path, err := getGlobalConfigPath()

Callers 2

LoadConfigFunction · 0.85
initConfigInteractiveFunction · 0.85

Calls 1

GetDefaultConfigFunction · 0.85

Tested by

no test coverage detected