func init() { bootstrap() path := Settings.InfoFile Info.Path = path repo, err := git.NewRepository(Settings.DenvHome) check(err) Info.Repository = repo if !pathutil.Exists(path) { Info.Flush() } Info.Load() }
func bootstrap() error { //TODO: maybe this should live somewhere else // Create DENVHOME if !pathutil.Exists(Settings.DenvHome) { err := os.MkdirAll(Settings.DenvHome, 0744) if err != nil { return err } } if !git.IsRepository(Settings.DenvHome) { repo, err := git.NewRepository(Settings.DenvHome) check(err) repo.Init() repo.Exclude("/.*") // exclude hidden root files } return nil }