31 lines
659 B
Go
31 lines
659 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"path/filepath"
|
||
|
|
||
|
"go.wit.com/gui"
|
||
|
"go.wit.com/lib/gui/shell"
|
||
|
)
|
||
|
|
||
|
func docsBox(vbox *gui.Node) {
|
||
|
group := vbox.NewGroup("Docs")
|
||
|
|
||
|
group.NewButton("run pkgsite", func() {
|
||
|
tmp := me.userHomePwd.String()
|
||
|
tmpDir := filepath.Join(tmp, "go/src")
|
||
|
os.Chdir(tmpDir)
|
||
|
pkgsite := filepath.Join(tmp, "go/bin", "pkgsite")
|
||
|
os.Unsetenv("GO111MODULE")
|
||
|
go shell.Run([]string{pkgsite})
|
||
|
shell.Run([]string{"ping", "-c", "3", "git.wit.org"})
|
||
|
})
|
||
|
|
||
|
group.NewButton("open docs in browser (localhost:8080)", func() {
|
||
|
me.autotypistWindow.Disable()
|
||
|
defer me.autotypistWindow.Enable()
|
||
|
|
||
|
shell.OpenBrowser("http://localhost:8080")
|
||
|
})
|
||
|
}
|