diff options
Diffstat (limited to 'update.go')
| -rw-r--r-- | update.go | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1,11 +1,13 @@ package forgepb -import ( - "os" -) +func (all *Repos) UpdateGoPath(name string, gopath string) bool { + oldr := all.DeleteByName(name) + if oldr == nil { + // nothing to update + return false + } -func (repos *Repos) UpdateGoPath(r *Repo, gopath string) { - r.Gopath = gopath - repos.ConfigSave() - os.Exit(0) + // update gopath and append it back to the list + oldr.GoPath = gopath + return all.Append(oldr) } |
