summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-18 15:13:55 -0500
committerJeff Carr <[email protected]>2025-03-18 15:13:55 -0500
commit4b2ac683b7725cec816e3e31f7512b7e3f082722 (patch)
treedb9476c37b9a7e35d422aafa9cf25e209baad81a
parent96aa1f09eaecc93bff5555670614fbfc36b75e14 (diff)
start using IterBy()
-rw-r--r--Makefile2
-rw-r--r--applyPatch.go2
-rw-r--r--windowRepos.go16
3 files changed, 9 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index b238f1c..b84ee48 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ andlabs: clean install
forge --gui andlabs
gocui: install
- forge --gui gocui --gui-verbose >/tmp/forge.log 2>&1
+ forge --gui gocui --gui-verbose --gui-file ../../toolkits/gocui/gocui.so >/tmp/forge.log 2>&1
# forge --gui gocui --gui-verbose --debugger
goimports:
diff --git a/applyPatch.go b/applyPatch.go
index 9abafef..8b05b18 100644
--- a/applyPatch.go
+++ b/applyPatch.go
@@ -160,7 +160,7 @@ func doRegister(newurl string) error {
}
test := strings.TrimSpace(string(body))
- for _, line := range strings.Split(test, "\n") {
+ for line := range strings.SplitSeq(test, "\n") {
line = strings.TrimSpace(line)
log.Info("server returned:", line)
}
diff --git a/windowRepos.go b/windowRepos.go
index c647eff..98e13ad 100644
--- a/windowRepos.go
+++ b/windowRepos.go
@@ -25,9 +25,7 @@ func makeReposWin() *gadgets.GenericWindow {
tb, box := makeStandardReposWindow("dirty repos", found)
hbox := box.Box().Horizontal()
hbox.NewButton("commit all", func() {
- all := found.SortByFullPath()
- for all.Scan() {
- repo := all.Next()
+ for repo := range found.IterByFullPath() {
log.Info("do commit here on", repo.GetGoPath())
}
log.Info("TODO: fix this")
@@ -55,9 +53,7 @@ func makeReposWin() *gadgets.GenericWindow {
// make the window for the first time
found := new(gitpb.Repos)
- all := me.forge.Repos.SortByFullPath()
- for all.Scan() {
- repo := all.Next()
+ for repo := range me.forge.Repos.IterByFullPath() {
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
continue
}
@@ -367,9 +363,11 @@ func makeWritableWindow(pb *gitpb.Repos) (*gadgets.GenericWindow, *gitpb.ReposTa
log.Info("todo: run git pull on each repo")
})
- grid.NewButton("do repos.ReScan()", func() {
- t.Update()
- })
+ /*
+ grid.NewButton("do repos.ReScan()", func() {
+ t.Update()
+ })
+ */
tbox := win.Bottom.Box()
t.SetParent(tbox)