func init() { ggConfig = GgConfig{Path: utils.UserHomeOrFatal() + "/.config/green-garden"} if source, err := ioutil.ReadFile(ggConfig.Path + "/config.yml"); err == nil { err = yaml.Unmarshal([]byte(source), &ggConfig) if err != nil { panic(err) } } log.Debug("Home folder is " + ggConfig.Path) }
func init() { cntConfig = CntConfig{} switch runtime.GOOS { case "windows": cntConfig.Path = utils.UserHomeOrFatal() + "/AppData/Local/Cnt" case "darwin": cntConfig.Path = utils.UserHomeOrFatal() + "/Library/Cnt" case "linux": cntConfig.Path = utils.UserHomeOrFatal() + "/.config/cnt" default: log.Get().Panic("Unsupported OS, please fill a bug repost") } cntConfig.AciPath = cntConfig.Path + "/aci" if source, err := ioutil.ReadFile(cntConfig.Path + "/config.yml"); err == nil { err = yaml.Unmarshal([]byte(source), &cntConfig) if err != nil { panic(err) } } log.Get().Debug("Home folder is " + cntConfig.Path) }