From 9d968721d0c3f553cd2034256c95f5b6b96cb962 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 11 Sep 2025 23:10:49 -0500 Subject: [PATCH] rm GOSRC --- config.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config.go b/config.go index 702daa9..a12cd0e 100644 --- a/config.go +++ b/config.go @@ -12,12 +12,12 @@ import ( "go.wit.com/log" ) -// write to ~/.config/forge/ unless ENV{FORGE_GOSRC} is set +// write to ~/.config/forge/ unless ENV{FORGE_REPOSDIR} is set func (all *Repos) ConfigSave() error { - if os.Getenv("FORGE_GOSRC") == "" { + if os.Getenv("FORGE_REPOSDIR") == "" { homeDir, _ := os.UserHomeDir() fullpath := filepath.Join(homeDir, ".config/forge") - os.Setenv("FORGE_GOSRC", fullpath) + os.Setenv("FORGE_REPOSDIR", fullpath) } if all == nil { log.Warn("gitpb all == nil") @@ -82,15 +82,15 @@ func (all *Repos) tryValidate() error { // fails. the file should be autogenerated. This is used // locally just for speed func (all *Repos) ConfigLoad() error { - if os.Getenv("FORGE_GOSRC") == "" { + if os.Getenv("FORGE_REPOSDIR") == "" { homeDir, _ := os.UserHomeDir() fullpath := filepath.Join(homeDir, ".config/forge") - os.Setenv("FORGE_GOSRC", fullpath) + os.Setenv("FORGE_REPOSDIR", fullpath) } var data []byte var err error - cfgname := filepath.Join(os.Getenv("FORGE_GOSRC"), "repos.pb") + cfgname := filepath.Join(os.Getenv("FORGE_REPOSDIR"), "repos.pb") if data, err = loadFile(cfgname); err != nil { // something went wrong loading the file // all.sampleConfig() // causes nil panic @@ -147,7 +147,7 @@ func loadFile(fullname string) ([]byte, error) { } func configWrite(filename string, data []byte) error { - fullname := filepath.Join(os.Getenv("FORGE_GOSRC"), filename) + fullname := filepath.Join(os.Getenv("FORGE_REPOSDIR"), filename) log.Infof("%s your repos have changed state. cached state. (%d) bytes\n", fullname, len(data)) cfgfile, err := os.OpenFile(fullname, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)