working towards global branch settings
repostatus improvements common branch handling scan all repos code cleanups check dirty before global delete go mod using a quieter gui smarter scripting Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
b4f1bf3836
commit
c408a7cca5
1
Makefile
1
Makefile
|
@ -1,4 +1,5 @@
|
||||||
all: build
|
all: build
|
||||||
|
reset
|
||||||
./autotypist
|
./autotypist
|
||||||
|
|
||||||
stderr: build
|
stderr: build
|
||||||
|
|
|
@ -20,23 +20,17 @@ func doesExist(path string) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
var quickCmds [][]string
|
|
||||||
var quickCmdLastPath string
|
|
||||||
var quickCmdDoNotRun bool = false
|
|
||||||
|
|
||||||
// only errors on bad errors
|
// only errors on bad errors
|
||||||
func quickCmd(fullpath string, cmd []string) bool {
|
func quickCmd(fullpath string, cmd []string) bool {
|
||||||
var err error
|
var err error
|
||||||
var b bool
|
var b bool
|
||||||
var output string
|
var output string
|
||||||
|
|
||||||
if quickCmdLastPath != fullpath {
|
if me.autoWorkingPwd.String() != fullpath {
|
||||||
quickCmds = append(quickCmds, []string{"cd", fullpath})
|
me.autoWorkingPwd.SetValue(fullpath)
|
||||||
quickCmdLastPath = fullpath
|
|
||||||
}
|
}
|
||||||
quickCmds = append(quickCmds, cmd)
|
|
||||||
log.Warn("RUN:", fullpath, cmd)
|
log.Warn("RUN:", fullpath, cmd)
|
||||||
if quickCmdDoNotRun {
|
if me.autoDryRun.Checked() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,14 +82,17 @@ func globalBuildOptions(box *gui.Node) {
|
||||||
newBranch.AddText("jcarr")
|
newBranch.AddText("jcarr")
|
||||||
newBranch.SetText("jcarr")
|
newBranch.SetText("jcarr")
|
||||||
|
|
||||||
|
me.autoWorkingPwd = gadgets.NewOneLiner(grid, "working directory (pwd)")
|
||||||
|
|
||||||
group2 := vbox.NewGroup("Run in every git repository")
|
group2 := vbox.NewGroup("Run in every git repository")
|
||||||
me.stopOnErrors = group2.NewCheckbox("Stop on errors")
|
me.stopOnErrors = group2.NewCheckbox("Stop on errors")
|
||||||
me.stopOnErrors.SetChecked(true)
|
me.stopOnErrors.SetChecked(true)
|
||||||
|
|
||||||
|
me.autoDryRun = group2.NewCheckbox("autotypist --dry-run")
|
||||||
|
me.autoDryRun.SetChecked(true)
|
||||||
|
|
||||||
group2.NewButton("run git status", func() {
|
group2.NewButton("run git status", func() {
|
||||||
quickCmdDoNotRun = false
|
me.autoWorkingPwd.SetValue("~/go/src")
|
||||||
quickCmdLastPath = "~/go/src"
|
|
||||||
quickCmds = [][]string{}
|
|
||||||
log.Warn("scanning allrepos")
|
log.Warn("scanning allrepos")
|
||||||
for _, path := range me.allrepos {
|
for _, path := range me.allrepos {
|
||||||
fullpath := "/home/jcarr/go/src/" + path
|
fullpath := "/home/jcarr/go/src/" + path
|
||||||
|
@ -104,7 +101,6 @@ func globalBuildOptions(box *gui.Node) {
|
||||||
})
|
})
|
||||||
|
|
||||||
me.rerunGoMod = group2.NewButton("remove go.mod & go.sum", func() {
|
me.rerunGoMod = group2.NewButton("remove go.mod & go.sum", func() {
|
||||||
quickCmdDoNotRun = false
|
|
||||||
for _, path := range me.allrepos {
|
for _, path := range me.allrepos {
|
||||||
fullpath := "/home/jcarr/go/src/" + path
|
fullpath := "/home/jcarr/go/src/" + path
|
||||||
if quickCmd(fullpath, []string{"rm", "-f", "go.mod", "go.sum"}) {
|
if quickCmd(fullpath, []string{"rm", "-f", "go.mod", "go.sum"}) {
|
||||||
|
@ -117,7 +113,6 @@ func globalBuildOptions(box *gui.Node) {
|
||||||
})
|
})
|
||||||
|
|
||||||
me.rerunGoMod = group2.NewButton("run go mod & go tidy", func() {
|
me.rerunGoMod = group2.NewButton("run go mod & go tidy", func() {
|
||||||
quickCmdDoNotRun = false
|
|
||||||
os.Unsetenv("GO111MODULE")
|
os.Unsetenv("GO111MODULE")
|
||||||
for _, path := range me.allrepos {
|
for _, path := range me.allrepos {
|
||||||
fullpath := "/home/jcarr/go/src/" + path
|
fullpath := "/home/jcarr/go/src/" + path
|
||||||
|
@ -127,7 +122,6 @@ func globalBuildOptions(box *gui.Node) {
|
||||||
})
|
})
|
||||||
|
|
||||||
me.rerunGoMod = group2.NewButton("git checkout go.mod & go.sum", func() {
|
me.rerunGoMod = group2.NewButton("git checkout go.mod & go.sum", func() {
|
||||||
quickCmdDoNotRun = false
|
|
||||||
for _, path := range me.allrepos {
|
for _, path := range me.allrepos {
|
||||||
fullpath := "/home/jcarr/go/src/" + path
|
fullpath := "/home/jcarr/go/src/" + path
|
||||||
quickCmd(fullpath, []string{"git", "checkout", "go.mod"})
|
quickCmd(fullpath, []string{"git", "checkout", "go.mod"})
|
||||||
|
|
|
@ -11,54 +11,27 @@ func globalResetOptions(box *gui.Node) {
|
||||||
|
|
||||||
buildOptions.NewLabel("start over")
|
buildOptions.NewLabel("start over")
|
||||||
buildOptions.NewButton("rm ~/go/src & ~/go/pkg", func() {
|
buildOptions.NewButton("rm ~/go/src & ~/go/pkg", func() {
|
||||||
var newCmds [][]string
|
|
||||||
var dirty bool = false
|
|
||||||
for repo, _ := range me.allrepos {
|
for repo, _ := range me.allrepos {
|
||||||
status := repo.getStatus()
|
// status := repo.getStatus()
|
||||||
if status == "dirty" {
|
if repo.status.CheckDirty() {
|
||||||
dirty = true
|
log.Warn("repo is dirty. commit your changes first", repo.String())
|
||||||
break
|
return
|
||||||
|
} else {
|
||||||
|
log.Warn("repo is not dirty", repo.String())
|
||||||
|
log.Warn("TODO: check things are pushed and check every dir in go/src/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newCmds = append(newCmds, []string{"cd", "/home/jcarr/"})
|
/*
|
||||||
newCmds = append(newCmds, []string{"rm", "-rf", "go/src/"})
|
newCmds = append(newCmds, []string{"cd", "/home/jcarr/"})
|
||||||
newCmds = append(newCmds, []string{"chmod", "700", "-R", "go/pkg/"})
|
newCmds = append(newCmds, []string{"rm", "-rf", "go/src/"})
|
||||||
newCmds = append(newCmds, []string{"rm", "-rf", "go/pkg/"})
|
newCmds = append(newCmds, []string{"chmod", "700", "-R", "go/pkg/"})
|
||||||
if dirty {
|
newCmds = append(newCmds, []string{"rm", "-rf", "go/pkg/"})
|
||||||
newCmds = append(newCmds, []string{"can't do this with dirty repos"})
|
if dirty {
|
||||||
doit.Disable()
|
newCmds = append(newCmds, []string{"can't do this with dirty repos"})
|
||||||
} else {
|
} else {
|
||||||
doit.Enable()
|
}
|
||||||
}
|
*/
|
||||||
me.script = newCmds
|
|
||||||
setGitCommands()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
buildOptions.NewSeparator("endStatusScans")
|
buildOptions.NewSeparator("endStatusScans")
|
||||||
buildOptions.NewSeparator("endStatusScans")
|
buildOptions.NewSeparator("endStatusScans")
|
||||||
|
|
||||||
// buildOptions.NewLabel("cmd")
|
|
||||||
cmds = group2.NewTextbox("ls")
|
|
||||||
|
|
||||||
buildOptions.NewLabel("--dry-run")
|
|
||||||
dryrun = buildOptions.NewButton("show commands", func() {
|
|
||||||
if goMake("--dry-run") {
|
|
||||||
log.Warn("EVERYTHING MIGHT HAVE WORKED")
|
|
||||||
} else {
|
|
||||||
log.Warn("EVERYTHING WILL NOT WORK")
|
|
||||||
dryrun.Disable()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
buildOptions.NewLabel("Doit")
|
|
||||||
doit = buildOptions.NewButton("run commands", func() {
|
|
||||||
doit.Disable()
|
|
||||||
log.Warn("should run the commands here")
|
|
||||||
// true here means dryrun == true. it's confusingly named
|
|
||||||
if goMake("--doit") {
|
|
||||||
log.Warn("EVERYTHING WORKED")
|
|
||||||
} else {
|
|
||||||
log.Warn("EVERYTHING DID NOT WORK")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,15 +21,13 @@ func globalTestingOptions(box *gui.Node) {
|
||||||
me.autoRebuildButton.SetLabel("rebuild autotypist")
|
me.autoRebuildButton.SetLabel("rebuild autotypist")
|
||||||
})
|
})
|
||||||
|
|
||||||
var everything *gui.Node
|
me.downloadEverythingButton = test1.NewButton("go get go.wit.com", func() {
|
||||||
everything = test1.NewButton("go get everything on go.wit.com", func() {
|
me.downloadEverythingButton.Disable()
|
||||||
quickCmdDoNotRun = false
|
me.autoWorkingPwd.SetValue("/home/jcarr/go/src")
|
||||||
quickCmds = [][]string{}
|
|
||||||
quickCmdLastPath = "/home/jcarr/go/src"
|
|
||||||
var perfect bool = true
|
var perfect bool = true
|
||||||
repos := myrepolist()
|
repos := myrepolist()
|
||||||
for _, line := range repos {
|
for _, line := range repos {
|
||||||
log.Warn("repo =", line)
|
log.Verbose("repo =", line)
|
||||||
path, _, _, _ := splitLine(line)
|
path, _, _, _ := splitLine(line)
|
||||||
path = strings.TrimSpace(path)
|
path = strings.TrimSpace(path)
|
||||||
if path == "#" {
|
if path == "#" {
|
||||||
|
@ -45,19 +43,17 @@ func globalTestingOptions(box *gui.Node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if perfect {
|
if perfect {
|
||||||
var notes [][]string
|
var notes string
|
||||||
notes = append(notes, []string{"you have already downloaded"})
|
notes = "you have already downloaded\neverything on go.wit.com"
|
||||||
notes = append(notes, []string{"everything on go.wit.com"})
|
me.autoWorkingPwd.SetValue(notes)
|
||||||
me.script = notes
|
me.downloadEverythingButton.Disable()
|
||||||
setGitCommands()
|
|
||||||
doit.Disable()
|
|
||||||
everything.Disable()
|
|
||||||
return
|
return
|
||||||
|
} else {
|
||||||
|
var notes string
|
||||||
|
notes = "download everything failed"
|
||||||
|
me.autoWorkingPwd.SetValue(notes)
|
||||||
|
me.downloadEverythingButton.Enable()
|
||||||
}
|
}
|
||||||
|
|
||||||
me.script = quickCmds
|
|
||||||
doit.Enable()
|
|
||||||
setGitCommands()
|
|
||||||
})
|
})
|
||||||
test1.NewButton("build all apps", func() {
|
test1.NewButton("build all apps", func() {
|
||||||
listWindow()
|
listWindow()
|
||||||
|
@ -65,11 +61,13 @@ func globalTestingOptions(box *gui.Node) {
|
||||||
test1.NewButton("repostatus.ListAll()", func() {
|
test1.NewButton("repostatus.ListAll()", func() {
|
||||||
repostatus.ListAll()
|
repostatus.ListAll()
|
||||||
})
|
})
|
||||||
|
test1.NewButton("repostatus.ScanGoSrc()", func() {
|
||||||
|
repostatus.ScanGoSrc()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func attemptAutoRebuild() {
|
func attemptAutoRebuild() {
|
||||||
os.Setenv("GO111MODULE", "off")
|
os.Setenv("GO111MODULE", "off")
|
||||||
quickCmdDoNotRun = false
|
|
||||||
|
|
||||||
fullpath := "/home/jcarr/go/"
|
fullpath := "/home/jcarr/go/"
|
||||||
quickCmd(fullpath, []string{"mkdir", "-p", "/home/jcarr/go/src/go.wit.com/apps/"})
|
quickCmd(fullpath, []string{"mkdir", "-p", "/home/jcarr/go/src/go.wit.com/apps/"})
|
||||||
|
@ -97,6 +95,4 @@ func attemptAutoRebuild() {
|
||||||
fullpath = "/home/jcarr/go/src/go.wit.com/apps/autotypist"
|
fullpath = "/home/jcarr/go/src/go.wit.com/apps/autotypist"
|
||||||
quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."})
|
quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."})
|
||||||
quickCmd(fullpath, []string{"go", "build", "-v", "-x"})
|
quickCmd(fullpath, []string{"go", "build", "-v", "-x"})
|
||||||
me.script = quickCmds
|
|
||||||
setGitCommands()
|
|
||||||
}
|
}
|
||||||
|
|
4
go.mod
4
go.mod
|
@ -3,9 +3,9 @@ module go.wit.com/apps/autotypist
|
||||||
go 1.21.4
|
go 1.21.4
|
||||||
|
|
||||||
require (
|
require (
|
||||||
go.wit.com/gui v0.12.19
|
go.wit.com/gui v0.12.20
|
||||||
go.wit.com/lib/debugger v0.12.7
|
go.wit.com/lib/debugger v0.12.7
|
||||||
go.wit.com/lib/gadgets v0.12.15
|
go.wit.com/lib/gadgets v0.12.16
|
||||||
go.wit.com/lib/gui/logsettings v0.10.2
|
go.wit.com/lib/gui/logsettings v0.10.2
|
||||||
go.wit.com/lib/gui/repostatus v0.12.20
|
go.wit.com/lib/gui/repostatus v0.12.20
|
||||||
go.wit.com/log v0.5.6
|
go.wit.com/log v0.5.6
|
||||||
|
|
10
go.sum
10
go.sum
|
@ -4,16 +4,14 @@ go.wit.com/dev/alexflint/scalar v1.2.1 h1:loXOcbVnd+8YeJRLey+XXidecBiedMDO00zQ26
|
||||||
go.wit.com/dev/alexflint/scalar v1.2.1/go.mod h1:+rYsfxqdI2cwA8kJ7GCMwWbNJvfvWUurOCXLiwdTtSs=
|
go.wit.com/dev/alexflint/scalar v1.2.1/go.mod h1:+rYsfxqdI2cwA8kJ7GCMwWbNJvfvWUurOCXLiwdTtSs=
|
||||||
go.wit.com/dev/davecgh/spew v1.1.4 h1:C9hj/rjlUpdK+E6aroyLjCbS5MFcyNUOuP1ICLWdNek=
|
go.wit.com/dev/davecgh/spew v1.1.4 h1:C9hj/rjlUpdK+E6aroyLjCbS5MFcyNUOuP1ICLWdNek=
|
||||||
go.wit.com/dev/davecgh/spew v1.1.4/go.mod h1:sihvWmnQ/09FWplnEmozt90CCVqBtGuPXM811tgfhFA=
|
go.wit.com/dev/davecgh/spew v1.1.4/go.mod h1:sihvWmnQ/09FWplnEmozt90CCVqBtGuPXM811tgfhFA=
|
||||||
go.wit.com/gui v0.12.19 h1:OEnsnZnec7Q2jZVjwl413V0wuVAAB4r2mGTY0IouBuw=
|
go.wit.com/gui v0.12.20 h1:mIc2DKGcpQjZdgtAj5qzkBrBDiteWfIaEpLyMnIBkh8=
|
||||||
go.wit.com/gui v0.12.19/go.mod h1:v2VgnOL3dlZ13KclYeedZ1cd20nQdvwjyJTNKvFX3DA=
|
go.wit.com/gui v0.12.20/go.mod h1:v2VgnOL3dlZ13KclYeedZ1cd20nQdvwjyJTNKvFX3DA=
|
||||||
go.wit.com/lib/debugger v0.12.7 h1:c8ehU7p2asb//K4YgC17XG4o2pPP+IZb9lR2a0nBio8=
|
go.wit.com/lib/debugger v0.12.7 h1:c8ehU7p2asb//K4YgC17XG4o2pPP+IZb9lR2a0nBio8=
|
||||||
go.wit.com/lib/debugger v0.12.7/go.mod h1:zcZstsgOcALjCNOiIE+KcKkrIF78ogYjwxmaQlBbmtQ=
|
go.wit.com/lib/debugger v0.12.7/go.mod h1:zcZstsgOcALjCNOiIE+KcKkrIF78ogYjwxmaQlBbmtQ=
|
||||||
go.wit.com/lib/gadgets v0.12.15 h1:C9q6wc45Trh5SrizD8lOXOWoJLGq/ESWwzjCVylZrNY=
|
go.wit.com/lib/gadgets v0.12.16 h1:xHz8zZiTe8xiGvfWs3s9drYUbePTT/Te58u7WXHjx0s=
|
||||||
go.wit.com/lib/gadgets v0.12.15/go.mod h1:Fxc7F8hGskpkWVAsXKhs4ilqUlAnikVXj4yzumtTYa0=
|
go.wit.com/lib/gadgets v0.12.16/go.mod h1:9779QoRZlk+G3/MCcX4Io1eH3HTLImE0AXdAMMdw+0U=
|
||||||
go.wit.com/lib/gui/logsettings v0.10.2 h1:xRx0AX1V74kC6CIm+ib6C3ziTcbBjR/Ju3rTLEpQMsw=
|
go.wit.com/lib/gui/logsettings v0.10.2 h1:xRx0AX1V74kC6CIm+ib6C3ziTcbBjR/Ju3rTLEpQMsw=
|
||||||
go.wit.com/lib/gui/logsettings v0.10.2/go.mod h1:v5XUQ6WyNyfScR9oOFhdz8p1wtxCpNWXK3DJ/dbLPVo=
|
go.wit.com/lib/gui/logsettings v0.10.2/go.mod h1:v5XUQ6WyNyfScR9oOFhdz8p1wtxCpNWXK3DJ/dbLPVo=
|
||||||
go.wit.com/lib/gui/repostatus v0.12.19 h1:Udi1g/gdrDLnKWvXfL5WdyJjRkbFYkEMx56iY9CN+BQ=
|
|
||||||
go.wit.com/lib/gui/repostatus v0.12.19/go.mod h1:EO5bI+/cGwHGBQG1S8pDtV58Rmw5HWbW9vZtFLg5Vkw=
|
|
||||||
go.wit.com/lib/gui/repostatus v0.12.20 h1:SPx45W8Yd6RZf0oZueXmMhlZsu3MVL8wdb5mVGovbfA=
|
go.wit.com/lib/gui/repostatus v0.12.20 h1:SPx45W8Yd6RZf0oZueXmMhlZsu3MVL8wdb5mVGovbfA=
|
||||||
go.wit.com/lib/gui/repostatus v0.12.20/go.mod h1:EO5bI+/cGwHGBQG1S8pDtV58Rmw5HWbW9vZtFLg5Vkw=
|
go.wit.com/lib/gui/repostatus v0.12.20/go.mod h1:EO5bI+/cGwHGBQG1S8pDtV58Rmw5HWbW9vZtFLg5Vkw=
|
||||||
go.wit.com/log v0.5.6 h1:rDC3ju95zfEads4f1Zm+QMkqjZ39CsYAT/UmQQs7VP4=
|
go.wit.com/log v0.5.6 h1:rDC3ju95zfEads4f1Zm+QMkqjZ39CsYAT/UmQQs7VP4=
|
||||||
|
|
34
main.go
34
main.go
|
@ -16,7 +16,7 @@ import (
|
||||||
var resToolkit embed.FS
|
var resToolkit embed.FS
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
me = new(repoType)
|
me = new(autoType)
|
||||||
me.allrepos = make(map[*repo]string)
|
me.allrepos = make(map[*repo]string)
|
||||||
|
|
||||||
me.myGui = gui.New()
|
me.myGui = gui.New()
|
||||||
|
@ -35,10 +35,15 @@ func main() {
|
||||||
func addRepo(grid *gui.Node, path string, master string, devel string, user string) {
|
func addRepo(grid *gui.Node, path string, master string, devel string, user string) {
|
||||||
newRepo := new(repo)
|
newRepo := new(repo)
|
||||||
|
|
||||||
|
if path == "" {
|
||||||
|
log.Warn("addRepo() got empty path", path, master, devel, user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if repostatus.VerifyLocalGoRepo(path) {
|
if repostatus.VerifyLocalGoRepo(path) {
|
||||||
log.Warn("newRepo actually exists", newRepo.getPath())
|
log.Verbose("newRepo actually exists", newRepo.getPath())
|
||||||
} else {
|
} else {
|
||||||
log.Warn("newRepo does not exist", newRepo.getPath())
|
log.Warn("repostatus.VerifyLocalGoRepo() failed for for", path, master, devel, user)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +60,7 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri
|
||||||
|
|
||||||
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
|
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
|
||||||
|
|
||||||
newRepo.showButton = grid.NewButton("Show()", func() {
|
newRepo.statusButton = grid.NewButton("Configure", func() {
|
||||||
if newRepo.status == nil {
|
if newRepo.status == nil {
|
||||||
log.Warn("status window doesn't exist")
|
log.Warn("status window doesn't exist")
|
||||||
return
|
return
|
||||||
|
@ -64,17 +69,19 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri
|
||||||
newRepo.status.Toggle()
|
newRepo.status.Toggle()
|
||||||
newRepo.status.Update()
|
newRepo.status.Update()
|
||||||
})
|
})
|
||||||
if path == "" {
|
|
||||||
newRepo.cButton.Hide()
|
// newRepo.status = repostatus.New(me.myGui, newRepo.path)
|
||||||
newRepo.pButton.Hide()
|
newRepo.status = repostatus.NewRepoStatusWindow(newRepo.path)
|
||||||
}
|
newRepo.hidden = false
|
||||||
newRepo.status = repostatus.New(me.myGui, newRepo.path)
|
newRepo.status.SetMainWorkingName(me.mainBranch.String())
|
||||||
newRepo.status.SetMasterBranchName(master)
|
newRepo.status.SetDevelWorkingName(me.develBranch.String())
|
||||||
|
newRepo.status.SetUserWorkingName(me.userBranch.String())
|
||||||
|
/*
|
||||||
newRepo.status.SetDevelBranchName(devel)
|
newRepo.status.SetDevelBranchName(devel)
|
||||||
newRepo.status.SetUserBranchName(user)
|
newRepo.status.SetUserBranchName(user)
|
||||||
newRepo.hidden = false
|
|
||||||
newRepo.status.Update()
|
newRepo.status.Update()
|
||||||
newRepo.newScan()
|
newRepo.newScan()
|
||||||
|
*/
|
||||||
me.allrepos[newRepo] = path
|
me.allrepos[newRepo] = path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +104,8 @@ func repoworld() {
|
||||||
reposbox = reposwin.Box().NewBox("bw vbox", false)
|
reposbox = reposwin.Box().NewBox("bw vbox", false)
|
||||||
reposwin.Draw()
|
reposwin.Draw()
|
||||||
reposwin.Custom = func() {
|
reposwin.Custom = func() {
|
||||||
log.Warn("GOT HERE")
|
log.Warn("GOT HERE: main() gadgets.NewBasicWindow() close")
|
||||||
|
log.Warn("Should I do something special here?")
|
||||||
}
|
}
|
||||||
|
|
||||||
reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)")
|
reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)")
|
||||||
|
@ -119,7 +127,7 @@ func repoworld() {
|
||||||
|
|
||||||
repos := myrepolist()
|
repos := myrepolist()
|
||||||
for _, line := range repos {
|
for _, line := range repos {
|
||||||
log.Warn("repo =", line)
|
log.Verbose("repo =", line)
|
||||||
path, mbranch, dbranch, ubranch := splitLine(line)
|
path, mbranch, dbranch, ubranch := splitLine(line)
|
||||||
if mbranch == "" {
|
if mbranch == "" {
|
||||||
mbranch = "master"
|
mbranch = "master"
|
||||||
|
|
|
@ -43,8 +43,6 @@ func myrepolist() []string {
|
||||||
|
|
||||||
func (r *repo) Hide() {
|
func (r *repo) Hide() {
|
||||||
r.pLabel.Hide()
|
r.pLabel.Hide()
|
||||||
r.pButton.Hide()
|
|
||||||
r.cButton.Hide()
|
|
||||||
r.lastTag.Hide()
|
r.lastTag.Hide()
|
||||||
r.vLabel.Hide()
|
r.vLabel.Hide()
|
||||||
|
|
||||||
|
@ -53,14 +51,12 @@ func (r *repo) Hide() {
|
||||||
r.userVersion.Hide()
|
r.userVersion.Hide()
|
||||||
|
|
||||||
r.dirtyLabel.Hide()
|
r.dirtyLabel.Hide()
|
||||||
r.showButton.Hide()
|
r.statusButton.Hide()
|
||||||
r.hidden = true
|
r.hidden = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *repo) Show() {
|
func (r *repo) Show() {
|
||||||
r.pLabel.Show()
|
r.pLabel.Show()
|
||||||
r.pButton.Show()
|
|
||||||
r.cButton.Show()
|
|
||||||
r.lastTag.Show()
|
r.lastTag.Show()
|
||||||
r.vLabel.Show()
|
r.vLabel.Show()
|
||||||
|
|
||||||
|
@ -69,6 +65,6 @@ func (r *repo) Show() {
|
||||||
r.userVersion.Show()
|
r.userVersion.Show()
|
||||||
|
|
||||||
r.dirtyLabel.Show()
|
r.dirtyLabel.Show()
|
||||||
r.showButton.Show()
|
r.statusButton.Show()
|
||||||
r.hidden = false
|
r.hidden = false
|
||||||
}
|
}
|
||||||
|
|
2
scan.go
2
scan.go
|
@ -14,7 +14,7 @@ func (r *repo) newScan() bool {
|
||||||
}
|
}
|
||||||
// r.scan()
|
// r.scan()
|
||||||
if repostatus.VerifyLocalGoRepo(r.getPath()) {
|
if repostatus.VerifyLocalGoRepo(r.getPath()) {
|
||||||
log.Warn("repo actually exists", r.getPath())
|
log.Verbose("repo actually exists", r.getPath())
|
||||||
} else {
|
} else {
|
||||||
log.Warn("repo does not exist", r.getPath())
|
log.Warn("repo does not exist", r.getPath())
|
||||||
return false
|
return false
|
||||||
|
|
28
structs.go
28
structs.go
|
@ -13,10 +13,9 @@ var reposbox *gui.Node
|
||||||
var reposgrid *gui.Node
|
var reposgrid *gui.Node
|
||||||
var reposgroup *gui.Node
|
var reposgroup *gui.Node
|
||||||
|
|
||||||
var me *repoType
|
var me *autoType
|
||||||
|
|
||||||
type repoType struct {
|
type autoType struct {
|
||||||
script [][]string
|
|
||||||
allrepos map[*repo]string
|
allrepos map[*repo]string
|
||||||
myGui *gui.Node
|
myGui *gui.Node
|
||||||
|
|
||||||
|
@ -43,25 +42,34 @@ type repoType struct {
|
||||||
// if checked, will stop trying to os.Exec() things after failure
|
// if checked, will stop trying to os.Exec() things after failure
|
||||||
stopOnErrors *gui.Node
|
stopOnErrors *gui.Node
|
||||||
|
|
||||||
autoRebuildButton *gui.Node // button to attempt to autorebuild
|
// button to attempt to autorebuild
|
||||||
|
autoRebuildButton *gui.Node
|
||||||
|
|
||||||
|
// checkbox for --dry-run
|
||||||
|
autoDryRun *gui.Node
|
||||||
|
|
||||||
|
// The current working directory
|
||||||
|
autoWorkingPwd *gadgets.OneLiner
|
||||||
|
|
||||||
|
downloadEverythingButton *gui.Node
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
var cmds *gui.Node
|
var cmds *gui.Node
|
||||||
var doit *gui.Node
|
var doit *gui.Node
|
||||||
var dryrun *gui.Node
|
var dryrun *gui.Node
|
||||||
|
*/
|
||||||
|
|
||||||
type repo struct {
|
type repo struct {
|
||||||
hidden bool
|
hidden bool
|
||||||
path string
|
path string
|
||||||
lasttagrev string
|
lasttagrev string
|
||||||
lasttag string
|
lasttag string
|
||||||
// tags []string
|
|
||||||
|
|
||||||
pLabel *gui.Node // path label
|
pLabel *gui.Node // path label
|
||||||
// bLabel *gui.Node // branch label
|
// bLabel *gui.Node // branch label
|
||||||
lastTag *gui.Node // last tagged version label
|
lastTag *gui.Node // last tagged version label
|
||||||
vLabel *gui.Node // version label
|
vLabel *gui.Node // version label
|
||||||
// tagsDrop *gui.Node // list of all tags
|
|
||||||
dirtyLabel *gui.Node // git state (dirty or not?)
|
dirtyLabel *gui.Node // git state (dirty or not?)
|
||||||
|
|
||||||
// masterName *gui.Node // the master branch name
|
// masterName *gui.Node // the master branch name
|
||||||
|
@ -71,9 +79,7 @@ type repo struct {
|
||||||
// userName *gui.Node // the jcarr branch name
|
// userName *gui.Node // the jcarr branch name
|
||||||
userVersion *gui.Node // the jcarr branch version
|
userVersion *gui.Node // the jcarr branch version
|
||||||
|
|
||||||
cButton *gui.Node // commit button
|
statusButton *gui.Node // opens up the status window
|
||||||
pButton *gui.Node // push button
|
|
||||||
showButton *gui.Node // the button!
|
|
||||||
|
|
||||||
status *repostatus.RepoStatus
|
status *repostatus.RepoStatus
|
||||||
}
|
}
|
||||||
|
|
15
unix.go
15
unix.go
|
@ -1,5 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
/*
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -7,7 +8,7 @@ import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var repopath string = "/home/jcarr/"
|
// var repopath string = "/home/jcarr/"
|
||||||
|
|
||||||
// if dryRun == true, then it just prints out the values
|
// if dryRun == true, then it just prints out the values
|
||||||
// but doesn't do anything
|
// but doesn't do anything
|
||||||
|
@ -55,14 +56,4 @@ func goMake(dryRun string) bool {
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
func setGitCommands() {
|
|
||||||
var tmp []string
|
|
||||||
// convert to displayable to the user text
|
|
||||||
for _, line := range me.script {
|
|
||||||
s := strings.Join(line, " ")
|
|
||||||
log.Warn("s =", s)
|
|
||||||
tmp = append(tmp, s)
|
|
||||||
}
|
|
||||||
cmds.SetText(strings.Join(tmp, "\n"))
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue