From 0c62ded7e96902a88f293cbabb9ba5292025549a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 22 Oct 2025 11:27:03 -0500 Subject: oops. haven't been testing building these --- Makefile | 6 +++--- init.go | 4 ++-- toolkitConfig.proto | 1 + toolkitConfig.save.go | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 15b11eb..80872c8 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -all: toolkitConfig.pb.go goimports vet +all: autogenpb goimports vet @echo This GO code passes the compile checks -toolkitConfig.pb.go: toolkitConfig.proto - make generate +autogenpb: + autogenpb --proto toolkitConfig.proto generate: clean go mod init diff --git a/init.go b/init.go index 0f0a3e7..35c6aa4 100644 --- a/init.go +++ b/init.go @@ -60,7 +60,7 @@ func New() *TreeInfo { } func (t *TreeInfo) ConfigFind(n string) (string, error) { - all := t.config.All() // get the list of repos + all := t.config.All() for all.Scan() { r := all.Next() if t.PluginName != r.Plugin { @@ -76,7 +76,7 @@ func (t *TreeInfo) ConfigFind(n string) (string, error) { func (t *TreeInfo) ConfigSave(newopt *ToolkitConfig) { t.configInsert(newopt) - config.ConfigSave(t.config) + config.Save(t.config) } // update the config option value (or append if new record) diff --git a/toolkitConfig.proto b/toolkitConfig.proto index 1ce14b4..bf1c7b8 100644 --- a/toolkitConfig.proto +++ b/toolkitConfig.proto @@ -16,4 +16,5 @@ message ToolkitConfigs { // `autogenpb:marshal` string uuid = 1; // `autogenpb:uuid:d7886d47-a3b9-43b9-b0f6-17074a9844e6` string version = 2; // `autogenpb:version:v0.0.1` repeated ToolkitConfig ToolkitConfigs = 3; + string filename = 4; // `autogenpb:save` -- this enables autogenerated pb.Load() and pb.Save() } diff --git a/toolkitConfig.save.go b/toolkitConfig.save.go index d4bbdba..0a911e8 100644 --- a/toolkitConfig.save.go +++ b/toolkitConfig.save.go @@ -14,7 +14,8 @@ import ( // load the ~/.config/forge/ files func configLoad() *ToolkitConfigs { cfg := NewToolkitConfigs() - err := config.ConfigLoad(cfg, "forge", "toolkit") + cfg.Filename = config.MakeConfigFilename("forge", "toolkit") + err := config.ReLoad(cfg) if err != nil { // first time user. insert a sample option cfg.sampleConfig() -- cgit v1.2.3