summaryrefslogtreecommitdiff
path: root/update.go
diff options
context:
space:
mode:
Diffstat (limited to 'update.go')
-rw-r--r--update.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/update.go b/update.go
index 2ad64cf..f1f1af3 100644
--- a/update.go
+++ b/update.go
@@ -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)
}