cmd shortcut to ignore errors

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-18 13:46:25 -06:00
parent 58fc261974
commit afcf7f87aa
3 changed files with 41 additions and 23 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.swp
/resources/*.so
myrepos
autotypist

View File

@ -21,6 +21,25 @@ func doesExist(path string) bool {
return true
}
// only errors on bad errors
func quickCmd(fullpath string, cmd []string) bool {
var err error
var b bool
var output string
cmd = []string{"mkdir", "-p", "go.wit.com/apps/"}
if err != nil {
err, b, output = repostatus.RunCmd(fullpath, cmd)
log.Error(err, b, string(output))
return false
} else if ! b {
log.Error(err, b, string(output))
return true
}
log.Warn("output = ", string(output))
return true
}
func globalBuildOptions(box *gui.Node) {
var setCurrentBranch *gui.Node
group1 := box.NewGroup("Global Build Options")
@ -53,6 +72,27 @@ func globalBuildOptions(box *gui.Node) {
setCurrentBranch.Set("set all branches to " + me.toMoveToBranch)
me.mainBranch.Disable()
}
groupvbox.NewButton("rebuild autotypist", func() {
fullpath := "/home/jcarr/go/src"
quickCmd(fullpath, []string{"mkdir", "-p", "go.wit.com/apps/"})
fullpath = "/home/jcarr/go/src/go.wit.com/apps/autotypist"
cmd := []string{"go", "get", "-v", "-u", "go.wit.com/apps/autotypist"}
err, b, output := repostatus.RunCmd(fullpath, cmd)
log.Warn(err, b, string(output))
cmd = []string{"go", "get", "-v", "-u", "go.wit.com/toolkits/debian"}
err, b, output = repostatus.RunCmd(fullpath, cmd)
log.Warn(err, b, string(output))
fullpath = "/home/jcarr/go/src/go.wit.com/toolkits/debian"
cmd = []string{"make"}
err, b, output = repostatus.RunCmd(fullpath, cmd)
log.Warn(err, b, string(output))
})
me.rerunGoMod = groupvbox.NewButton("re-run go mod & go tidy", func() {
me.rerunGoMod.Disable()
log.Warn("scanning allrepos")

View File

@ -70,29 +70,6 @@ func globalResetOptions(box *gui.Node) {
setGitCommands()
})
buildOptions.NewLabel("rebuild autotypist")
buildOptions.NewButton("go get", func() {
var newCmds [][]string
newCmds = append(newCmds, []string{"cd", "."})
newCmds = append(newCmds, []string{"mkdir", "-p", "go/src/go.wit.com/apps/"})
newCmds = append(newCmds, []string{"cd", "go/src/go.wit.com/apps/"})
newCmds = append(newCmds, []string{"go", "get", "-v", "-u", "go.wit.com/apps/autotypist"})
newCmds = append(newCmds, []string{"cd", "go/src/go.wit.com/apps/autotypist"})
newCmds = append(newCmds, []string{"go", "get", "-v", "-u", "."})
newCmds = append(newCmds, []string{"go", "get", "-v", "go.wit.com/gui/toolkits"})
newCmds = append(newCmds, []string{"cd", "go/src/go.wit.com/gui/toolkits/andlabs"})
newCmds = append(newCmds, []string{"go", "get", "-v", "-u", "."})
newCmds = append(newCmds, []string{"cd", "go/src/go.wit.com/gui/toolkits/gocui"})
newCmds = append(newCmds, []string{"go", "get", "-v", "-u", "."})
newCmds = append(newCmds, []string{"cd", "go/src/go.wit.com/gui/toolkits"})
newCmds = append(newCmds, []string{"make"})
newCmds = append(newCmds, []string{"cd", "go/src/go.wit.com/apps/myrepos"})
newCmds = append(newCmds, []string{"make"})
me.script = newCmds
setGitCommands()
doit.Enable()
})
buildOptions.NewSeparator("endStatusScans")
buildOptions.NewSeparator("endStatusScans")