diff options
| author | Jeff Carr <[email protected]> | 2025-09-11 01:53:53 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-11 01:53:53 -0500 |
| commit | dbde2f51b8acb4043203b5592531c6715896c800 (patch) | |
| tree | bb892866022b2f8045784091b181592dc480b3c8 /config.go | |
| parent | ac107331fc376edc5343732f7ebcd0d8e3177282 (diff) | |
cleanup config file handling
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 30 |
1 files changed, 9 insertions, 21 deletions
@@ -18,13 +18,15 @@ import ( func (f *Forge) ConfigSave() error { var err error - // backup the current config files - if e := f.backupConfig(); e != nil { - log.Info("forge.BackupConfig() error", e) - err = e - // continue here? notsure. could be bad either way - // out of disk space? - } + /* + // backup the current config files + if e := f.backupConfig(); e != nil { + log.Info("forge.BackupConfig() error", e) + err = e + // continue here? notsure. could be bad either way + // out of disk space? + } + */ if f.Config != nil { if e := f.Config.ConfigSave(); e != nil { log.Info("forge.Config.ConfigSave() error", e) @@ -101,9 +103,6 @@ func (c *ForgeConfigs) ConfigLoad(fullpath string) error { log.Info("However, the config files could not be loaded") } - // first time user. make a template config file - c.sampleConfig() - return nil } @@ -161,17 +160,6 @@ func configWrite(filename string, data []byte) error { cfgfile.Write([]byte("# git repos you have write access to. That is, where you can run 'git push'\n")) cfgfile.Write([]byte("\n")) } - if filename == "forge.json" { - // add header - cfgfile.Write([]byte("\n")) - cfgfile.Write([]byte("# this file is intended to be used to customize settings on what\n")) - cfgfile.Write([]byte("# git repos you have write access to. That is, where you can run 'git push'\n")) - cfgfile.Write([]byte("\n")) - cfgfile.Write([]byte("# this file is parsed only if forge.text is missing\n")) - cfgfile.Write([]byte("# also, these comment lines don't work in json files and have to be removed for Marshal() to work\n")) - cfgfile.Write([]byte("# probably, JSON syntax for this is just going to be deprecated for the TEXT syntax\n")) - cfgfile.Write([]byte("\n")) - } cfgfile.Write(data) return nil } |
