MCPcopy Index your code
hub / github.com/commitdev/zero / LoadConfig

Function LoadConfig

internal/config/projectconfig/project_config.go:67–79  ·  view source on GitHub ↗
(filePath string)

Source from the content-addressed store, hash-verified

65}
66
67func LoadConfig(filePath string) *ZeroProjectConfig {
68 config := &ZeroProjectConfig{}
69 data, err := ioutil.ReadFile(filePath)
70 if err != nil {
71 exit.Fatal("failed to read config: %v", err)
72 }
73 err = yaml.Unmarshal(data, &config)
74 if err != nil {
75 exit.Fatal("failed to parse config: %v", err)
76 }
77 flog.Debugf("Loaded project config: %s from %s", config.Name, filePath)
78 return config
79}
80
81func (c *ZeroProjectConfig) Print() {
82 pp.Println(c)

Callers 5

ApplyFunction · 0.92
TestLoadConfigFunction · 0.92
CreateFunction · 0.92

Calls 2

FatalFunction · 0.92
DebugfFunction · 0.92

Tested by 3

TestLoadConfigFunction · 0.74