go status moving here
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
2aed84cf3a
commit
9f26bc2d44
5
draw.go
5
draw.go
|
@ -124,11 +124,16 @@ func (rs *RepoStatus) drawGitStatus() {
|
|||
|
||||
rs.dirtyLabel = gadgets.NewOneLiner(newgrid, "dirty")
|
||||
rs.readOnly = gadgets.NewOneLiner(newgrid, "read only")
|
||||
rs.goSumStatus = gadgets.NewOneLiner(newgrid, "go mod status")
|
||||
|
||||
rs.speed = gadgets.NewOneLiner(newgrid, "refresh speed =")
|
||||
rs.speedActual = gadgets.NewOneLiner(newgrid, "speed actual =")
|
||||
}
|
||||
|
||||
func (rs *RepoStatus) SetGoSumStatus(s string) {
|
||||
rs.goSumStatus.SetText(s)
|
||||
}
|
||||
|
||||
func (rs *RepoStatus) drawGitCommands() {
|
||||
rs.gitCommandsGroup = rs.window.Box().NewGroup("git commands")
|
||||
newgrid := rs.gitCommandsGroup.NewGrid("gridnuts", 2, 2)
|
||||
|
|
12
git.go
12
git.go
|
@ -109,12 +109,12 @@ func (rs *RepoStatus) CheckDirty() bool {
|
|||
rs.dirtyLabel.SetValue("no")
|
||||
return false
|
||||
}
|
||||
log.Log(WARN, "CheckDirty() true", rs.realPath.String())
|
||||
log.Log(WARN, "CheckDirty() cmd =", cmd)
|
||||
log.Log(WARN, "CheckDirty() b =", b)
|
||||
log.Log(WARN, "CheckDirty() path =", path)
|
||||
log.Log(WARN, "CheckDirty() out =", out)
|
||||
log.Log(WARN, "CheckDirty() err =", err)
|
||||
log.Log(INFO, "CheckDirty() true", rs.realPath.String())
|
||||
log.Log(INFO, "CheckDirty() cmd =", cmd)
|
||||
log.Log(INFO, "CheckDirty() b =", b)
|
||||
log.Log(INFO, "CheckDirty() path =", path)
|
||||
log.Log(INFO, "CheckDirty() out =", out)
|
||||
log.Log(INFO, "CheckDirty() err =", err)
|
||||
rs.dirtyLabel.SetValue("dirty")
|
||||
return true
|
||||
|
||||
|
|
|
@ -364,6 +364,15 @@ func (rs *RepoStatus) CheckGoSum() (bool, string) {
|
|||
log.Log(WARN, " NOT FOUND BUT IGNORING FOR NOW")
|
||||
}
|
||||
}
|
||||
err, output := rs.RunCmd([]string{"git", "branch", "--remotes"})
|
||||
if err == nil {
|
||||
lines := strings.Split(output, "\n")
|
||||
for i, s := range lines {
|
||||
log.Log(WARN, "add line", i, s)
|
||||
}
|
||||
} else {
|
||||
log.Log(WARN, "git branch --remotes failed", err)
|
||||
}
|
||||
return true, ""
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,9 @@ type RepoStatus struct {
|
|||
|
||||
window *gadgets.BasicWindow
|
||||
|
||||
dirtyLabel *gadgets.OneLiner
|
||||
readOnly *gadgets.OneLiner
|
||||
dirtyLabel *gadgets.OneLiner
|
||||
readOnly *gadgets.OneLiner
|
||||
goSumStatus *gadgets.OneLiner
|
||||
|
||||
path *gadgets.OneLiner
|
||||
goSrcPath *gadgets.OneLiner
|
||||
|
|
4
unix.go
4
unix.go
|
@ -222,13 +222,13 @@ func VerifyLocalGoRepo(gorepo string) bool {
|
|||
|
||||
// Form the path to the home Git directory
|
||||
gitDir := filepath.Join(usr.HomeDir, "go/src/", gorepo, ".git")
|
||||
log.Log(WARN, "VerifyLocalGoRepo() checking directory:", gitDir)
|
||||
log.Log(INFO, "VerifyLocalGoRepo() checking directory:", gitDir)
|
||||
if IsDirectory(gitDir) {
|
||||
return true
|
||||
}
|
||||
goDir := filepath.Join(usr.HomeDir, "go/src/", gorepo)
|
||||
gomod := goDir + "/go.mod"
|
||||
log.Log(WARN, "VerifyLocalGoRepo() checking for go.mod :", gomod)
|
||||
log.Log(INFO, "VerifyLocalGoRepo() checking for go.mod :", gomod)
|
||||
_, err = os.Stat(gomod)
|
||||
if os.IsNotExist(err) {
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue