more display fixes
This commit is contained in:
parent
967fc70a48
commit
b6373df539
30
docs.go
30
docs.go
|
@ -1,46 +1,16 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/gui/repolist"
|
|
||||||
"go.wit.com/lib/gui/shell"
|
"go.wit.com/lib/gui/shell"
|
||||||
"go.wit.com/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func docsBox(vbox *gui.Node) {
|
func docsBox(vbox *gui.Node) {
|
||||||
group := vbox.NewGroup("Docs")
|
group := vbox.NewGroup("Docs")
|
||||||
|
|
||||||
group.NewButton("make 'go.work' file", func() {
|
|
||||||
me.autotypistWindow.Disable()
|
|
||||||
|
|
||||||
goSrcDir := me.goSrcPwd.String()
|
|
||||||
filename := filepath.Join(goSrcDir, "go.work")
|
|
||||||
|
|
||||||
f, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE, 0600)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
defer f.Close()
|
|
||||||
fmt.Fprintln(f, "go 1.21.4")
|
|
||||||
fmt.Fprintln(f, "")
|
|
||||||
fmt.Fprintln(f, "use (")
|
|
||||||
for _, repo := range repolist.AllRepos() {
|
|
||||||
if repo.Status.Exists("go.mod") {
|
|
||||||
fmt.Fprintln(f, "\t"+repo.Status.GoPath())
|
|
||||||
} else {
|
|
||||||
log.Info("missing go.mod for", repo.Status.Path())
|
|
||||||
// repo.Status.MakeRedomod()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fmt.Fprintln(f, ")")
|
|
||||||
|
|
||||||
me.autotypistWindow.Enable()
|
|
||||||
})
|
|
||||||
|
|
||||||
group.NewButton("run pkgsite", func() {
|
group.NewButton("run pkgsite", func() {
|
||||||
tmp := me.userHomePwd.String()
|
tmp := me.userHomePwd.String()
|
||||||
tmpDir := filepath.Join(tmp, "go/src")
|
tmpDir := filepath.Join(tmp, "go/src")
|
||||||
|
|
|
@ -114,7 +114,7 @@ func globalBuildOptions(vbox *gui.Node) {
|
||||||
|
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
||||||
grid.NewGroup("update from upstream")
|
grid.NewGroup("update all repos from upstream")
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
grid.NewButton("git pull", func() {
|
grid.NewButton("git pull", func() {
|
||||||
me.Disable()
|
me.Disable()
|
||||||
|
@ -156,6 +156,8 @@ func globalBuildOptions(vbox *gui.Node) {
|
||||||
})
|
})
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
||||||
|
grid.NewGroup("build")
|
||||||
|
grid.NextRow()
|
||||||
me.autoRebuildButton = grid.NewButton("rebuild autotypist", func() {
|
me.autoRebuildButton = grid.NewButton("rebuild autotypist", func() {
|
||||||
me.autoRebuildButton.Disable()
|
me.autoRebuildButton.Disable()
|
||||||
me.autoRebuildButton.SetLabel("running....")
|
me.autoRebuildButton.SetLabel("running....")
|
||||||
|
@ -165,7 +167,6 @@ func globalBuildOptions(vbox *gui.Node) {
|
||||||
})
|
})
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
||||||
|
|
||||||
grid.NewButton("go build", func() {
|
grid.NewButton("go build", func() {
|
||||||
me.Disable()
|
me.Disable()
|
||||||
defer me.Enable()
|
defer me.Enable()
|
||||||
|
|
|
@ -56,9 +56,9 @@ func globalDisplayOptions(vbox *gui.Node) {
|
||||||
os.Setenv("REPO_AUTO_SCAN", "true")
|
os.Setenv("REPO_AUTO_SCAN", "true")
|
||||||
|
|
||||||
scanbox.NewButton("scan now", func() {
|
scanbox.NewButton("scan now", func() {
|
||||||
log.Info("re-scanning repos now")
|
log.Info("re-scanning now")
|
||||||
i, s := me.repos.View.ScanRepositories()
|
i, s := me.repos.View.ScanRepositories()
|
||||||
log.Info("re-scanning repos done", i, s)
|
log.Info("re-scanning done", i, "repos in", s)
|
||||||
})
|
})
|
||||||
|
|
||||||
var tagsW *tagWindow
|
var tagsW *tagWindow
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
|
"go.wit.com/lib/gui/repolist"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,6 +17,34 @@ func globalResetOptions(box *gui.Node) {
|
||||||
|
|
||||||
grid := group2.RawGrid()
|
grid := group2.RawGrid()
|
||||||
|
|
||||||
|
grid.NewButton("remake 'go.work' file", func() {
|
||||||
|
me.autotypistWindow.Disable()
|
||||||
|
|
||||||
|
goSrcDir := me.goSrcPwd.String()
|
||||||
|
filename := filepath.Join(goSrcDir, "go.work")
|
||||||
|
|
||||||
|
f, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE, 0600)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
fmt.Fprintln(f, "go 1.21.4")
|
||||||
|
fmt.Fprintln(f, "")
|
||||||
|
fmt.Fprintln(f, "use (")
|
||||||
|
for _, repo := range repolist.AllRepos() {
|
||||||
|
if repo.Status.Exists("go.mod") {
|
||||||
|
fmt.Fprintln(f, "\t"+repo.Status.GoPath())
|
||||||
|
} else {
|
||||||
|
log.Info("missing go.mod for", repo.Status.Path())
|
||||||
|
// repo.Status.MakeRedomod()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Fprintln(f, ")")
|
||||||
|
|
||||||
|
me.autotypistWindow.Enable()
|
||||||
|
})
|
||||||
|
grid.NextRow()
|
||||||
|
|
||||||
grid.NewButton("delete user branches", func() {
|
grid.NewButton("delete user branches", func() {
|
||||||
os.Setenv("REPO_FORCE", "off")
|
os.Setenv("REPO_FORCE", "off")
|
||||||
loop := me.repos.View.ReposSortByName()
|
loop := me.repos.View.ReposSortByName()
|
||||||
|
|
Loading…
Reference in New Issue