closer. only show writable so I can fix the GUI
This commit is contained in:
parent
c32aea103c
commit
43385fcb43
10
init.go
10
init.go
|
@ -19,11 +19,17 @@ func Init(f *forgepb.Forge, g *gui.Node) *RepoList {
|
||||||
me.Enable()
|
me.Enable()
|
||||||
me.forge = f
|
me.forge = f
|
||||||
|
|
||||||
|
me.viewName = "autotypist"
|
||||||
|
|
||||||
repos := me.forge.Repos.SortByPath()
|
repos := me.forge.Repos.SortByPath()
|
||||||
for repos.Scan() {
|
for repos.Scan() {
|
||||||
repo := repos.Next()
|
repo := repos.Next()
|
||||||
log.Info("repo scan directory:", repo.FullPath)
|
if me.forge.IsReadOnly(repo.GoPath) {
|
||||||
me.AddRepo(repo)
|
log.Info("repo scan readonly directory:", repo.FullPath)
|
||||||
|
} else {
|
||||||
|
log.Info("repo scan writable directory:", repo.FullPath)
|
||||||
|
me.AddRepo(repo)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
me.Enable()
|
me.Enable()
|
||||||
|
|
39
newRepo.go
39
newRepo.go
|
@ -60,43 +60,6 @@ func (r *RepoRow) Show2() {
|
||||||
r.hidden = false
|
r.hidden = false
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
func (r *RepoList) NewRepo(path string) (*RepoRow, error) {
|
|
||||||
test, ok := r.allrepos[path]
|
|
||||||
if ok {
|
|
||||||
// this repo already exists
|
|
||||||
return test, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
status, err := repostatus.New(path)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
newRepo := new(RepoRow)
|
|
||||||
newRepo.Status = status
|
|
||||||
newRepo.Status.InitOk = false
|
|
||||||
|
|
||||||
newRepo.pLabel = r.reposgrid.NewLabel(path).SetProgName("path")
|
|
||||||
newRepo.hidden = false
|
|
||||||
|
|
||||||
r.allrepos[path] = newRepo
|
|
||||||
newRepo.NewScan()
|
|
||||||
|
|
||||||
switch r.viewName {
|
|
||||||
case "autotypist":
|
|
||||||
r.makeAutotypistView(newRepo)
|
|
||||||
case "guireleaser":
|
|
||||||
r.makeGuireleaserView(newRepo)
|
|
||||||
default:
|
|
||||||
r.makeAutotypistView(newRepo)
|
|
||||||
}
|
|
||||||
r.reposgrid.NextRow()
|
|
||||||
newRepo.Status.InitOk = true
|
|
||||||
newRepo.Hide()
|
|
||||||
return newRepo, nil
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// adds a gui row to the table based off the repo protobuf
|
// adds a gui row to the table based off the repo protobuf
|
||||||
func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
|
func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
|
||||||
test, ok := r.allrepos[pb.GetGoPath()]
|
test, ok := r.allrepos[pb.GetGoPath()]
|
||||||
|
@ -130,7 +93,7 @@ func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
|
||||||
}
|
}
|
||||||
r.reposgrid.NextRow()
|
r.reposgrid.NextRow()
|
||||||
newRepo.Status.InitOk = true
|
newRepo.Status.InitOk = true
|
||||||
newRepo.Hide()
|
// newRepo.Hide()
|
||||||
return newRepo, nil
|
return newRepo, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue