summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-29 22:38:22 -0600
committerJeff Carr <[email protected]>2024-11-29 22:38:22 -0600
commit57cbde285b380d9146b3ee46116e5fa90f292444 (patch)
treed770cc5ae649b5db239ae321b5aafff6e2739824 /init.go
parentf750b96cc55d42f4edfcd324ef9878525d0cf428 (diff)
InitBox() for autotypist
Diffstat (limited to 'init.go')
-rw-r--r--init.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/init.go b/init.go
index 5237713..f1cc9fa 100644
--- a/init.go
+++ b/init.go
@@ -35,3 +35,29 @@ func Init(f *forgepb.Forge, g *gui.Node) *RepoList {
me.Enable()
return me
}
+
+func InitBox(f *forgepb.Forge, newbox *gui.Node) *RepoList {
+ me = new(RepoList)
+
+ // make a window with a table of all the repos
+ me.AutotypistView(newbox)
+
+ me.Enable()
+ me.forge = f
+
+ me.viewName = "autotypist"
+
+ repos := me.forge.Repos.SortByPath()
+ for repos.Scan() {
+ repo := repos.Next()
+ if me.forge.IsReadOnly(repo.GoPath) {
+ log.Info("repo scan readonly directory:", repo.FullPath)
+ } else {
+ log.Info("repo scan writable directory:", repo.FullPath)
+ me.AddRepo(repo)
+ }
+ }
+
+ me.Enable()
+ return me
+}