cleaner repo list window
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
5f382cd5e3
commit
70bea42623
|
@ -89,7 +89,10 @@ func globalBuildOptions(box *gui.Node) {
|
|||
newBranch.SetText("jcarr")
|
||||
|
||||
group2 := vbox.NewGroup("Run in every git repository")
|
||||
group2.NewButton("git status", func() {
|
||||
me.stopOnErrors = group2.NewCheckbox("Stop on errors")
|
||||
me.stopOnErrors.SetChecked(true)
|
||||
|
||||
group2.NewButton("run git status", func() {
|
||||
quickCmdDoNotRun = false
|
||||
quickCmdLastPath = "~/go/src"
|
||||
quickCmds = [][]string{}
|
||||
|
@ -101,7 +104,16 @@ func globalBuildOptions(box *gui.Node) {
|
|||
})
|
||||
|
||||
me.rerunGoMod = group2.NewButton("remove go.mod & go.sum", func() {
|
||||
log.Info("TODO: remove them")
|
||||
quickCmdDoNotRun = false
|
||||
for _, path := range me.allrepos {
|
||||
fullpath := "/home/jcarr/go/src/" + path
|
||||
if quickCmd(fullpath, []string{"rm", "-f", "go.mod", "go.sum"}) {
|
||||
log.Info("rm go.mod FAILED in repo", fullpath, me.stopOnErrors.Bool())
|
||||
if me.stopOnErrors.Bool() {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
me.rerunGoMod = group2.NewButton("run go mod & go tidy", func() {
|
||||
|
@ -113,4 +125,13 @@ func globalBuildOptions(box *gui.Node) {
|
|||
quickCmd(fullpath, []string{"go", "mod", "tidy"})
|
||||
}
|
||||
})
|
||||
|
||||
me.rerunGoMod = group2.NewButton("git checkout go.mod & go.sum", func() {
|
||||
quickCmdDoNotRun = false
|
||||
for _, path := range me.allrepos {
|
||||
fullpath := "/home/jcarr/go/src/" + path
|
||||
quickCmd(fullpath, []string{"git", "checkout", "go.mod"})
|
||||
quickCmd(fullpath, []string{"git", "checkout", "go.sum"})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
30
main.go
30
main.go
|
@ -44,17 +44,17 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri
|
|||
|
||||
newRepo.path = path
|
||||
newRepo.pLabel = grid.NewLabel(path).SetProgName("path")
|
||||
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
|
||||
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
|
||||
|
||||
newRepo.masterName = grid.NewLabel("").SetProgName("masterName")
|
||||
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
|
||||
|
||||
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
|
||||
newRepo.develName = grid.NewLabel("").SetProgName("develName")
|
||||
newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion")
|
||||
newRepo.userName = grid.NewLabel("").SetProgName("userName")
|
||||
newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion")
|
||||
|
||||
newRepo.dirtyLabel = grid.NewLabel("")
|
||||
|
||||
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
|
||||
|
||||
newRepo.showButton = grid.NewButton("Show()", func() {
|
||||
if newRepo.status == nil {
|
||||
log.Warn("status window doesn't exist")
|
||||
|
@ -101,18 +101,20 @@ func repoworld() {
|
|||
}
|
||||
|
||||
reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)")
|
||||
reposgrid = reposgroup.NewGrid("test", 11, 1)
|
||||
reposgrid = reposgroup.NewGrid("test", 8, 1)
|
||||
|
||||
reposgrid.NewLabel("") // path goes here
|
||||
|
||||
reposgrid.NewLabel("")
|
||||
reposgrid.NewLabel("last tag").SetProgName("last tag")
|
||||
reposgrid.NewLabel("Current Version").SetProgName("Current Version")
|
||||
reposgrid.NewLabel("master")
|
||||
reposgrid.NewLabel("version")
|
||||
reposgrid.NewLabel("devel")
|
||||
reposgrid.NewLabel("version")
|
||||
reposgrid.NewLabel("user")
|
||||
reposgrid.NewLabel("version")
|
||||
|
||||
reposgrid.NewLabel("master version")
|
||||
reposgrid.NewLabel("devel version")
|
||||
reposgrid.NewLabel("user version")
|
||||
|
||||
reposgrid.NewLabel("Status")
|
||||
|
||||
reposgrid.NewLabel("Current Version").SetProgName("Current Version")
|
||||
|
||||
reposgrid.NewLabel("Show()")
|
||||
|
||||
repos := myrepolist()
|
||||
|
|
|
@ -48,12 +48,10 @@ func (r *repo) Hide() {
|
|||
r.lastTag.Hide()
|
||||
r.vLabel.Hide()
|
||||
|
||||
r.masterName.Hide()
|
||||
r.masterVersion.Hide()
|
||||
r.develName.Hide()
|
||||
r.develVersion.Hide()
|
||||
r.userName.Hide()
|
||||
r.userVersion.Hide()
|
||||
|
||||
r.dirtyLabel.Hide()
|
||||
r.showButton.Hide()
|
||||
r.hidden = true
|
||||
|
@ -66,12 +64,10 @@ func (r *repo) Show() {
|
|||
r.lastTag.Show()
|
||||
r.vLabel.Show()
|
||||
|
||||
r.masterName.Show()
|
||||
r.masterVersion.Show()
|
||||
r.develName.Show()
|
||||
r.develVersion.Show()
|
||||
r.userName.Show()
|
||||
r.userVersion.Show()
|
||||
|
||||
r.dirtyLabel.Show()
|
||||
r.showButton.Show()
|
||||
r.hidden = false
|
||||
|
|
30
scan.go
30
scan.go
|
@ -19,20 +19,26 @@ func (r *repo) newScan() bool {
|
|||
log.Warn("repo does not exist", r.getPath())
|
||||
return false
|
||||
}
|
||||
mn := r.status.GetMasterBranchName()
|
||||
r.masterName.SetLabel(mn)
|
||||
mv := r.status.GetMasterVersion()
|
||||
r.masterVersion.SetLabel(mv)
|
||||
mname := r.status.GetMasterBranchName()
|
||||
mver := r.status.GetMasterVersion()
|
||||
if mname != "guimaster" {
|
||||
mver = mver + " (" + mname + ")"
|
||||
}
|
||||
r.masterVersion.SetLabel(mver)
|
||||
|
||||
dn := r.status.GetDevelBranchName()
|
||||
r.develName.SetLabel(dn)
|
||||
dv := r.status.GetDevelVersion()
|
||||
r.develVersion.SetLabel(dv)
|
||||
dname := r.status.GetDevelBranchName()
|
||||
dver := r.status.GetDevelVersion()
|
||||
if dname != "devel" {
|
||||
dver = dver + " (" + dname + ")"
|
||||
}
|
||||
r.develVersion.SetLabel(dver)
|
||||
|
||||
un := r.status.GetUserBranchName()
|
||||
r.userName.SetLabel(un)
|
||||
uv := r.status.GetUserVersion()
|
||||
r.userVersion.SetLabel(uv)
|
||||
uname := r.status.GetUserBranchName()
|
||||
uver := r.status.GetUserVersion()
|
||||
if uname != "jcarr" {
|
||||
uver = uver + " (" + uname + ")"
|
||||
}
|
||||
r.userVersion.SetLabel(uver)
|
||||
|
||||
cbname := r.status.GetCurrentBranchName()
|
||||
cbversion := r.status.GetCurrentBranchVersion()
|
||||
|
|
13
structs.go
13
structs.go
|
@ -20,8 +20,8 @@ type repoType struct {
|
|||
allrepos map[*repo]string
|
||||
myGui *gui.Node
|
||||
|
||||
// #### autotypist window
|
||||
autotypistWindow *gadgets.BasicWindow
|
||||
|
||||
// #### autotypist Global Display Options
|
||||
autoHidePerfect *gui.Node
|
||||
|
||||
|
@ -39,8 +39,9 @@ type repoType struct {
|
|||
|
||||
// this button will regenerate everyones go.mod & go.sum
|
||||
rerunGoMod *gui.Node
|
||||
// #### autotypist Global Distructive & Reset Options
|
||||
// #### autotypist window end
|
||||
|
||||
// if checked, will stop trying to os.Exec() things after failure
|
||||
stopOnErrors *gui.Node
|
||||
}
|
||||
|
||||
var cmds *gui.Node
|
||||
|
@ -61,11 +62,11 @@ type repo struct {
|
|||
// tagsDrop *gui.Node // list of all tags
|
||||
dirtyLabel *gui.Node // git state (dirty or not?)
|
||||
|
||||
masterName *gui.Node // the master branch name
|
||||
// masterName *gui.Node // the master branch name
|
||||
masterVersion *gui.Node // the master branch version
|
||||
develName *gui.Node // the devel branch name
|
||||
// develName *gui.Node // the devel branch name
|
||||
develVersion *gui.Node // the devel branch version
|
||||
userName *gui.Node // the jcarr branch name
|
||||
// userName *gui.Node // the jcarr branch name
|
||||
userVersion *gui.Node // the jcarr branch version
|
||||
|
||||
cButton *gui.Node // commit button
|
||||
|
|
Loading…
Reference in New Issue