summaryrefslogtreecommitdiff
path: root/repomap.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-04 15:35:48 -0600
committerJeff Carr <[email protected]>2024-12-04 15:35:48 -0600
commit0463030e80f480f0d38989f4231db8b1651b40bc (patch)
tree7c9da2db3130f939a7fd74864a54ac21474cc3b7 /repomap.go
parent923160d70cd4f21896d6c57a39bdcce3e1ae0af6 (diff)
general improvements
Diffstat (limited to 'repomap.go')
-rw-r--r--repomap.go64
1 files changed, 0 insertions, 64 deletions
diff --git a/repomap.go b/repomap.go
deleted file mode 100644
index 8b23368..0000000
--- a/repomap.go
+++ /dev/null
@@ -1,64 +0,0 @@
-package main
-
-import (
- "os"
- "strings"
-
- "go.wit.com/lib/gui/shell"
- "go.wit.com/log"
-)
-
-func repomap() {
- var changed bool = false
- if argv.Repomap == "" {
- return
- }
- data, _ := os.ReadFile(argv.Repomap)
-
- for _, line := range strings.Split(string(data), "\n") {
- if line == "" {
- continue
- }
- if strings.HasPrefix(line, "#") {
- continue
- }
- parts := strings.Fields(line)
- gopath := parts[0]
- url := "https://" + parts[1]
- var comment string
- if len(parts) > 1 {
- comment = strings.Join(parts[2:], " ")
- }
- repo := me.forge.Repos.FindByGoPath(gopath)
- if argv.Force && argv.Clone {
- cmd := []string{"go-clone", "--recursive", gopath}
- shell.RunRealtime(cmd)
- continue
- }
- if repo == nil {
- if argv.Clone {
- // me.forge.Clone(gopath)
- } else {
- log.Info(gopath, "need to clone")
- }
- } else {
- if repo.URL != url {
- log.Info(gopath, "url wrong", repo.URL, "vs", url)
- log.Info("\tcomment", comment)
- repo.URL = url
- changed = true
- }
- if repo.Desc != comment && !(comment == "") {
- log.Info(gopath, "comment wrong", repo.Desc, "vs", comment)
- repo.Desc = comment
- changed = true
- }
- }
- }
-
- if changed {
- me.forge.Repos.ConfigSave()
- log.Info("config saved")
- os.Exit(0)
- }
-}