diff options
| author | Jeff Carr <[email protected]> | 2024-11-20 15:57:34 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-20 15:57:34 -0600 |
| commit | 704d06ba87ac8bc4af4abc1ed88efed82df7127d (patch) | |
| tree | 57c9fed02e508c51b50cb046e9fae3662f0e02a0 /forgeConfig/main.go | |
| parent | f1c2695662ea01e05271505e7d5c49f8590b7ff7 (diff) | |
UpdateGoPath() (probably without memory corruption)
Diffstat (limited to 'forgeConfig/main.go')
| -rw-r--r-- | forgeConfig/main.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/forgeConfig/main.go b/forgeConfig/main.go index 8e08878..20df841 100644 --- a/forgeConfig/main.go +++ b/forgeConfig/main.go @@ -23,25 +23,22 @@ func main() { loop := repos.SortByName() // get the list of repos for loop.Scan() { r := loop.Repo() - log.Info("repo:", r.Name, r.Gopath) + log.Info("repo:", r.Name, r.GoPath) } os.Exit(0) } if argv.Update { - r := repos.FindByName(argv.Name) // find the repo - if r == nil { - log.Info("rep:", argv.Name, "not found") - os.Exit(-1) + if repos.UpdateGoPath(argv.Name, argv.GoPath) { + // save updated config file + repos.ConfigSave() } - r.Gopath = argv.GoPath - repos.ConfigSave() os.Exit(0) } if argv.Add { log.Info("going to add a new repo", argv.Name, argv.GoPath) new1 := new(forgepb.Repo) new1.Name = argv.Name - new1.Gopath = argv.GoPath + new1.GoPath = argv.GoPath if repos.Append(new1) { log.Info("added", new1.Name, "ok") } else { |
