diff options
| author | Jeff Carr <[email protected]> | 2024-12-13 12:57:02 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-13 12:57:02 -0600 |
| commit | adef980837a2d75f7fd0bb03a600f98f5081f89d (patch) | |
| tree | 45ceb56699e725fc9c8b2c57675d196466bf5430 /config.go | |
| parent | c5f7570834f092608cd2137e966399f44aa02d36 (diff) | |
store autogenerated files in git notes
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -43,7 +43,8 @@ func (all *Repos) ConfigLoad() error { var data []byte var err error - if data, err = loadFile("repos.pb"); err != nil { + cfgname := filepath.Join(os.Getenv("FORGE_GOSRC"), "repos.pb") + if data, err = loadFile(cfgname); err != nil { // something went wrong loading the file return err } @@ -71,14 +72,13 @@ func (all *Repos) ConfigLoad() error { } return err } - log.Info("gitpb.Init() ", len(all.Repos), "repos in ~/.config/forge/repos.pb") + log.Info("gitpb.Init() ", len(all.Repos), "repos in", cfgname) return nil } return nil } -func loadFile(filename string) ([]byte, error) { - fullname := filepath.Join(os.Getenv("FORGE_GOSRC"), filename) +func loadFile(fullname string) ([]byte, error) { data, err := os.ReadFile(fullname) if errors.Is(err, os.ErrNotExist) { // if file does not exist, just return nil. this |
