diff --git a/globalResetOptions.go b/globalResetOptions.go index cb326c2..2c53822 100644 --- a/globalResetOptions.go +++ b/globalResetOptions.go @@ -74,6 +74,40 @@ func globalResetOptions(box *gui.Node) { }) grid.NextRow() + grid.NewButton("rm -f go.mod go.sum", func() { + me.Disable() + loop := me.repos.View.ReposSortByName() + for loop.Scan() { + repo := loop.Repo() + if repo.Status.Whitelist { + continue + } + if repo.Status.ReadOnly() { + continue + } + repo.Status.Run([]string{"rm", "-f", "go.mod", "go.sum"}) + } + me.Enable() + }) + grid.NextRow() + + grid.NewButton("git reset --hard", func() { + me.Disable() + loop := me.repos.View.ReposSortByName() + for loop.Scan() { + repo := loop.Repo() + if repo.Status.Whitelist { + continue + } + if repo.Status.ReadOnly() { + continue + } + repo.Status.Run([]string{"git", "reset", "--hard"}) + } + me.Enable() + }) + grid.NextRow() + grid.NewLabel("start over") me.deleteGoSrcPkgB = grid.NewButton("rm ~/go/src & ~/go/pkg", func() { var state string = me.deleteGoSrcPkgB.String() @@ -123,41 +157,18 @@ func globalResetOptions(box *gui.Node) { } func attemptAutoRebuild() { - os.Setenv("GO111MODULE", "off") + gosrc := me.goSrcPwd.String() - version := "latest" + quickCmd(gosrc, []string{"go-clone", "--recursive", "go.wit.com/apps/autotypist"}) + quickCmd(gosrc, []string{"go-clone", "--recursive", "go.wit.com/toolkits/debian"}) + quickCmd(gosrc, []string{"go-clone", "--recursive", "go.wit.com/toolkits/tree"}) + quickCmd(gosrc, []string{"go-clone", "--recursive", "go.wit.com/toolkits/nocui"}) + quickCmd(gosrc, []string{"go-clone", "--recursive", "go.wit.com/toolkits/gocui"}) + quickCmd(gosrc, []string{"go-clone", "--recursive", "go.wit.com/toolkits/andlabs"}) - homeDir := me.userHomePwd.String() - quickCmd(homeDir, []string{"mkdir", "-p", "go/src/go.wit.com/apps/"}) - fullpath := filepath.Join(homeDir, "go/src/go.wit.com/apps/") + quickCmd(filepath.Join(gosrc, "go.wit.com/toolkits/nocui/"), []string{"make"}) + quickCmd(filepath.Join(gosrc, "go.wit.com/toolkits/gocui/"), []string{"make"}) + quickCmd(filepath.Join(gosrc, "go.wit.com/toolkits/andlabs/"), []string{"make"}) - 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"}) - - os.Unsetenv("GO111MODULE") - quickCmd(homeDir, []string{"mkdir", "-p", "go/lib"}) - fullpath = filepath.Join(homeDir, "go/src/go.wit.com/toolkits/nocui/") - libfile := filepath.Join(homeDir, "go/lib/nocui.so") - quickCmd(fullpath, []string{"go", "mod", "init"}) - quickCmd(fullpath, []string{"go", "mod", "tidy"}) - quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", libfile}) - - fullpath = filepath.Join(homeDir, "go/src/go.wit.com/toolkits/gocui/") - libfile = filepath.Join(homeDir, "go/lib/gocui.so") - quickCmd(fullpath, []string{"go", "mod", "init"}) - quickCmd(fullpath, []string{"go", "mod", "tidy"}) - quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", libfile}) - - fullpath = filepath.Join(homeDir, "go/src/go.wit.com/toolkits/andlabs/") - libfile = filepath.Join(homeDir, "go/lib/andlabs.so") - quickCmd(fullpath, []string{"go", "mod", "init"}) - quickCmd(fullpath, []string{"go", "mod", "tidy"}) - quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", libfile}) - - fullpath = filepath.Join(homeDir, "go/src/go.wit.com") - quickCmd(fullpath, []string{"go", "install", "-v", "go.wit.com/apps/autotypist@" + version}) + quickCmd(filepath.Join(gosrc, "go.wit.com/apps/autotypist/"), []string{"make", "build"}) }