summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-11 01:53:53 -0500
committerJeff Carr <[email protected]>2025-09-11 01:53:53 -0500
commitdbde2f51b8acb4043203b5592531c6715896c800 (patch)
treebb892866022b2f8045784091b181592dc480b3c8 /config.go
parentac107331fc376edc5343732f7ebcd0d8e3177282 (diff)
cleanup config file handling
Diffstat (limited to 'config.go')
-rw-r--r--config.go30
1 files changed, 9 insertions, 21 deletions
diff --git a/config.go b/config.go
index a6cfd4a..963202f 100644
--- a/config.go
+++ b/config.go
@@ -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
}