InitBox() for autotypist

This commit is contained in:
Jeff Carr 2024-11-29 22:38:22 -06:00
parent f750b96cc5
commit 57cbde285b
1 changed files with 26 additions and 0 deletions

26
init.go
View File

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