package main import ( "os" "strings" "go.wit.com/lib/gui/repostatus" "go.wit.com/log" "go.wit.com/gui" ) // things being testing func globalTestingOptions(box *gui.Node) { test1 := box.NewGroup("testing build") me.autoRebuildButton = test1.NewButton("rebuild autotypist", func() { me.autoRebuildButton.Disable() me.autoRebuildButton.SetLabel("running....") attemptAutoRebuild() me.autoRebuildButton.Enable() me.autoRebuildButton.SetLabel("rebuild autotypist") }) var everything *gui.Node everything = test1.NewButton("go get everything on go.wit.com", func() { quickCmdDoNotRun = false quickCmds = [][]string{} quickCmdLastPath = "/home/jcarr/go/src" var perfect bool = true repos := myrepolist() for _, line := range repos { log.Warn("repo =", line) path, _, _, _ := splitLine(line) path = strings.TrimSpace(path) if path == "#" { // skip comment lines continue } if doesExist("/home/jcarr/go/src/" + path) { continue } // attempt to download it quickCmd("/home/jcarr/go/src/go.wit.com", []string{"go", "get", "-v", path}) perfect = false } if perfect { var notes [][]string notes = append(notes, []string{"you have already downloaded"}) notes = append(notes, []string{"everything on go.wit.com"}) me.script = notes setGitCommands() doit.Disable() everything.Disable() return } me.script = quickCmds doit.Enable() setGitCommands() }) test1.NewButton("build all apps", func() { listWindow() }) test1.NewButton("repostatus.ListAll()", func() { repostatus.ListAll() }) } func attemptAutoRebuild() { os.Setenv("GO111MODULE", "off") quickCmdDoNotRun = false fullpath := "/home/jcarr/go/" quickCmd(fullpath, []string{"mkdir", "-p", "/home/jcarr/go/src/go.wit.com/apps/"}) fullpath = "/home/jcarr/go/src/go.wit.com/apps/" quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/apps/autotypist"}) quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/toolkits/debian"}) quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/toolkits/tree"}) quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/toolkits/nocui"}) quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/toolkits/gocui"}) quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/toolkits/andlabs"}) fullpath = "/home/jcarr/go/src/go.wit.com/toolkits/nocui/" quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."}) quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", "../nocui.so"}) fullpath = "/home/jcarr/go/src/go.wit.com/toolkits/gocui/" quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."}) quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", "../gocui.so"}) fullpath = "/home/jcarr/go/src/go.wit.com/toolkits/andlabs/" quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."}) quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", "../andlabs.so"}) fullpath = "/home/jcarr/go/src/go.wit.com/apps/autotypist" quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."}) quickCmd(fullpath, []string{"go", "build", "-v", "-x"}) me.script = quickCmds setGitCommands() }