summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-11 23:10:49 -0500
committerJeff Carr <[email protected]>2025-09-11 23:10:49 -0500
commit9d968721d0c3f553cd2034256c95f5b6b96cb962 (patch)
tree2c3047b2f8f9473fb432df52a050b5fcc131565b
parent5a980584746bbeaa24fc24463af46f64e9277669 (diff)
rm GOSRC
-rw-r--r--config.go14
1 files 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)