summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-03 13:54:36 -0500
committerJeff Carr <[email protected]>2025-09-03 13:54:36 -0500
commit98cc06ab8fc98b728107fff135b107dcdb56fb2a (patch)
treecabb2d4c475868ad783578d958ec3e1e5946f690 /config.go
parent888442708cefe9e089bb97a99e696cb6995bfbab (diff)
lots of Init() cleanups
Diffstat (limited to 'config.go')
-rw-r--r--config.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/config.go b/config.go
index db5ce26..2af14d8 100644
--- a/config.go
+++ b/config.go
@@ -19,7 +19,7 @@ import (
func (f *Forge) ConfigSave() error {
var err error
// backup the current config files
- if e := backupConfig(); e != nil {
+ if e := f.backupConfig(); e != nil {
log.Info("forge.BackupConfig() error", e)
err = e
// continue here? notsure. could be bad either way
@@ -45,7 +45,7 @@ func (f *Forge) ConfigSave() error {
return err
}
-// write to ~/.config/forge/ unless ENV{FORGE_CONFIG} is set
+// write to ~/.config/forge/
func (f *ForgeConfigs) ConfigSave() error {
data, err := f.Marshal()
if err != nil {
@@ -64,12 +64,7 @@ func (f *ForgeConfigs) ConfigSave() error {
}
// load the ~/.config/forge/ files
-func (c *ForgeConfigs) ConfigLoad() error {
- if os.Getenv("FORGE_CONFIG") == "" {
- homeDir, _ := os.UserHomeDir()
- fullpath := filepath.Join(homeDir, ".config/forge")
- os.Setenv("FORGE_CONFIG", fullpath)
- }
+func (c *ForgeConfigs) ConfigLoad(fullpath string) error {
// var data []byte
// var err error
if c == nil {