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 +}