2024-01-20 17:17:48 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"strings"
|
|
|
|
|
2024-01-21 03:22:51 -06:00
|
|
|
"go.wit.com/lib/gui/repostatus"
|
2024-01-20 17:17:48 -06:00
|
|
|
"go.wit.com/log"
|
|
|
|
|
|
|
|
"go.wit.com/gui"
|
|
|
|
)
|
|
|
|
|
|
|
|
// things being testing
|
|
|
|
func globalTestingOptions(box *gui.Node) {
|
|
|
|
test1 := box.NewGroup("testing build")
|
2024-01-21 03:22:51 -06:00
|
|
|
me.autoRebuildButton = test1.NewButton("rebuild autotypist", func() {
|
|
|
|
me.autoRebuildButton.Disable()
|
|
|
|
me.autoRebuildButton.SetLabel("running....")
|
|
|
|
attemptAutoRebuild()
|
|
|
|
me.autoRebuildButton.Enable()
|
|
|
|
me.autoRebuildButton.SetLabel("rebuild autotypist")
|
2024-01-20 17:17:48 -06:00
|
|
|
})
|
|
|
|
|
2024-01-23 11:22:33 -06:00
|
|
|
me.downloadEverythingButton = test1.NewButton("go get go.wit.com", func() {
|
|
|
|
me.downloadEverythingButton.Disable()
|
|
|
|
me.autoWorkingPwd.SetValue("/home/jcarr/go/src")
|
2024-01-20 17:17:48 -06:00
|
|
|
var perfect bool = true
|
|
|
|
repos := myrepolist()
|
|
|
|
for _, line := range repos {
|
2024-01-23 11:22:33 -06:00
|
|
|
log.Verbose("repo =", line)
|
2024-01-20 17:17:48 -06:00
|
|
|
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 {
|
2024-01-23 11:22:33 -06:00
|
|
|
var notes string
|
|
|
|
notes = "you have already downloaded\neverything on go.wit.com"
|
|
|
|
me.autoWorkingPwd.SetValue(notes)
|
|
|
|
me.downloadEverythingButton.Disable()
|
2024-01-20 17:17:48 -06:00
|
|
|
return
|
2024-01-23 11:22:33 -06:00
|
|
|
} else {
|
|
|
|
var notes string
|
|
|
|
notes = "download everything failed"
|
|
|
|
me.autoWorkingPwd.SetValue(notes)
|
|
|
|
me.downloadEverythingButton.Enable()
|
2024-01-20 17:17:48 -06:00
|
|
|
}
|
|
|
|
})
|
2024-01-25 13:09:33 -06:00
|
|
|
test1.NewButton("go.wit.com/list", func() {
|
2024-01-20 17:17:48 -06:00
|
|
|
listWindow()
|
|
|
|
})
|
2024-01-21 03:22:51 -06:00
|
|
|
test1.NewButton("repostatus.ListAll()", func() {
|
|
|
|
repostatus.ListAll()
|
|
|
|
})
|
2024-01-23 11:22:33 -06:00
|
|
|
test1.NewButton("repostatus.ScanGoSrc()", func() {
|
|
|
|
repostatus.ScanGoSrc()
|
|
|
|
})
|
2024-01-21 03:22:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func attemptAutoRebuild() {
|
|
|
|
os.Setenv("GO111MODULE", "off")
|
|
|
|
|
|
|
|
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"})
|
2024-01-20 17:17:48 -06:00
|
|
|
}
|