diff options
| author | Jeff Carr <[email protected]> | 2024-11-28 00:02:27 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-28 00:02:27 -0600 |
| commit | 0401b949c6f900891f1eefaba41295d2c2a96b07 (patch) | |
| tree | b95a0a23fe444e212ab873f90b2f347303785b56 /config.go | |
| parent | 54a93cd5ebbaf7ed72704c1af9a8be5b8c71f5bd (diff) | |
added Init() and a Forge struct
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -12,7 +12,7 @@ import ( ) // write to ~/.config/forge/ unless ENV{FORGE_HOME} is set -func (m *ForgeConfigs) ConfigSave() error { +func (f *Forge) ConfigSave() error { if os.Getenv("FORGE_HOME") == "" { homeDir, _ := os.UserHomeDir() fullpath := filepath.Join(homeDir, ".config/forge") @@ -22,7 +22,7 @@ func (m *ForgeConfigs) ConfigSave() error { if err := backupConfig(); err != nil { return err } - data, err := m.Marshal() + data, err := f.Config.Marshal() if err != nil { log.Info("proto.Marshal() failed len", len(data), err) return err @@ -30,10 +30,10 @@ func (m *ForgeConfigs) ConfigSave() error { log.Info("proto.Marshal() worked len", len(data)) configWrite("forge.pb", data) - s := m.FormatTEXT() + s := f.Config.FormatTEXT() configWrite("forge.text", []byte(s)) - s = m.FormatJSON() + s = f.Config.FormatJSON() configWrite("forge.json", []byte(s)) return nil } |
