summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config.go')
-rw-r--r--config.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/config.go b/config.go
index 4d86b81..2fc02d0 100644
--- a/config.go
+++ b/config.go
@@ -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