more things moved to gitpb
This commit is contained in:
parent
5d232293a0
commit
a8d32f0e16
6
Makefile
6
Makefile
|
@ -1,13 +1,9 @@
|
||||||
all:
|
all: goimports
|
||||||
@GO111MODULE=off go vet
|
@GO111MODULE=off go vet
|
||||||
@echo go vet: this go library package builds okay
|
@echo go vet: this go library package builds okay
|
||||||
|
|
||||||
goimports:
|
goimports:
|
||||||
goimports -w *.go
|
goimports -w *.go
|
||||||
|
|
||||||
redomod: clean
|
|
||||||
GO111MODULE= go mod init
|
|
||||||
GO111MODULE= go mod tidy
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f go.*
|
rm -f go.*
|
||||||
|
|
21
scan.go
21
scan.go
|
@ -5,6 +5,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -41,21 +42,25 @@ func (r *RepoList) ScanRepositories() (int, string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RepoRow) NewScan() int {
|
func (r *RepoRow) NewScan() int {
|
||||||
|
return r.NewScan2(r.pb)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *RepoRow) NewScan2(pb *gitpb.Repo) int {
|
||||||
var changed int = 0
|
var changed int = 0
|
||||||
if r.Status == nil {
|
if r.Status == nil {
|
||||||
log.Log(REPOWARN, "repo.Status = nil. not initialized for some reason")
|
log.Log(REPOWARN, "repo.Status = nil. not initialized for some reason")
|
||||||
return changed
|
return changed
|
||||||
}
|
}
|
||||||
|
if pb == nil {
|
||||||
|
log.Log(REPOWARN, "NewScan() pb = nil")
|
||||||
|
return changed
|
||||||
|
}
|
||||||
|
|
||||||
// run the repostatus update
|
// run the repostatus update
|
||||||
r.Status.Update()
|
r.Status.Update()
|
||||||
|
|
||||||
if r.lastTag != nil {
|
if r.lastTag != nil {
|
||||||
if r.pb != nil {
|
r.lastTag.SetLabel(pb.GetLastTag())
|
||||||
r.lastTag.SetLabel(r.pb.GetLastTag())
|
|
||||||
} else {
|
|
||||||
log.Info("r.pb was nil")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.masterVersion == nil {
|
if r.masterVersion == nil {
|
||||||
|
@ -64,9 +69,9 @@ func (r *RepoRow) NewScan() int {
|
||||||
if r.pb == nil {
|
if r.pb == nil {
|
||||||
panic("what the fuck pb")
|
panic("what the fuck pb")
|
||||||
}
|
}
|
||||||
r.masterVersion.SetLabel(r.pb.GetMasterVersion())
|
r.masterVersion.SetLabel(pb.GetMasterVersion())
|
||||||
r.develVersion.SetLabel(r.pb.GetDevelVersion())
|
r.develVersion.SetLabel(pb.GetDevelVersion())
|
||||||
r.userVersion.SetLabel(r.pb.GetUserVersion())
|
r.userVersion.SetLabel(pb.GetUserVersion())
|
||||||
r.gitState.SetLabel(r.Status.GitState())
|
r.gitState.SetLabel(r.Status.GitState())
|
||||||
r.currentName.SetLabel(r.Status.GetCurrentBranchName())
|
r.currentName.SetLabel(r.Status.GetCurrentBranchName())
|
||||||
r.currentVersion.SetLabel(r.Status.GetCurrentBranchVersion())
|
r.currentVersion.SetLabel(r.Status.GetCurrentBranchVersion())
|
||||||
|
|
Loading…
Reference in New Issue