summaryrefslogtreecommitdiff
path: root/forgeConfig/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-20 21:22:05 -0600
committerJeff Carr <[email protected]>2024-11-20 21:22:05 -0600
commitce06800c41750f901c43cb35bcf9df8863dc3686 (patch)
treeba6fc30078dd4c91d0dd514a83b47ede29fb096e /forgeConfig/main.go
parent704d06ba87ac8bc4af4abc1ed88efed82df7127d (diff)
boo. was wrong. had to redo a lot
Diffstat (limited to 'forgeConfig/main.go')
-rw-r--r--forgeConfig/main.go26
1 files changed, 14 insertions, 12 deletions
diff --git a/forgeConfig/main.go b/forgeConfig/main.go
index 20df841..434f222 100644
--- a/forgeConfig/main.go
+++ b/forgeConfig/main.go
@@ -1,7 +1,6 @@
package main
import (
- "fmt"
"os"
"go.wit.com/lib/protobuf/forgepb"
@@ -20,39 +19,41 @@ func main() {
}
if argv.List {
log.Info(forgepb.RepoHeader())
- loop := repos.SortByName() // get the list of repos
+ loop := repos.SortByPath() // get the list of repos
for loop.Scan() {
r := loop.Repo()
- log.Info("repo:", r.Name, r.GoPath)
+ log.Info("repo:", r.GoPath)
}
os.Exit(0)
}
if argv.Update {
- if repos.UpdateGoPath(argv.Name, argv.GoPath) {
- // save updated config file
- repos.ConfigSave()
- }
+ /*
+ if repos.UpdateGoPath(argv.Name, argv.GoPath) {
+ // save updated config file
+ repos.ConfigSave()
+ }
+ */
os.Exit(0)
}
if argv.Add {
- log.Info("going to add a new repo", argv.Name, argv.GoPath)
+ log.Info("going to add a new repo", argv.GoPath)
new1 := new(forgepb.Repo)
- new1.Name = argv.Name
new1.GoPath = argv.GoPath
if repos.Append(new1) {
- log.Info("added", new1.Name, "ok")
+ log.Info("added", new1.GoPath, "ok")
} else {
- log.Info("added", new1.Name, "failed")
+ log.Info("added", new1.GoPath, "failed")
os.Exit(-1)
}
repos.ConfigSave()
os.Exit(0)
}
- testMemoryCorruption(repos)
+ // testMemoryCorruption(repos)
repos.ConfigSave()
}
+/*
// this fucks shit up
func testMemoryCorruption(all *forgepb.Repos) *forgepb.Repos {
new1 := new(forgepb.Repo)
@@ -110,3 +111,4 @@ func testMemoryCorruption(all *forgepb.Repos) *forgepb.Repos {
fmt.Println("packages are:", len(all.Repos))
return all
}
+*/