diff options
| author | Jeff Carr <[email protected]> | 2025-02-22 06:52:40 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-22 06:52:40 -0600 |
| commit | ba514f7827865b8503c50f8a3dde35433798bfb5 (patch) | |
| tree | 9f0ae185a01d4fc9beb2dbbbe12ee73bc6997a93 /doHowto.go | |
| parent | 3d58bc1c327a84f38516bce7da029493cb8beb4a (diff) | |
better instructions
Diffstat (limited to 'doHowto.go')
| -rw-r--r-- | doHowto.go | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/doHowto.go b/doHowto.go new file mode 100644 index 0000000..f9d220d --- /dev/null +++ b/doHowto.go @@ -0,0 +1,85 @@ +// Copyright 2017-2025 WIT.COM Inc. All rights reserved. +// Use of this source code is governed by the GPL 3.0 + +package main + +// An app to submit patches for the 30 GO GUI repos + +import ( + "go.wit.com/lib/fhelp" + "go.wit.com/lib/gui/shell" + "go.wit.com/log" +) + +func makeHowtoWin() *genericWindow { + howtoWin := initGenericWindow("Howto", "forge -- a GUI tool for git repostories") + tmp := `A good way to see how forge works is to download forge + + This will 'git clone' a few things (~50 repos): + ` + howtoWin.group.NewLabel(tmp) + grid := howtoWin.group.RawGrid() + grid.NewLabel("forge") + grid.NewLabel("the sources for forge") + grid.NextRow() + + grid.NewLabel("autogenpb") + grid.NewLabel("generates needed code for working with the protobuf files") + grid.NextRow() + + grid.NewLabel("go-clone") + grid.NewLabel("recursively 'git clone' dependencies based on go.mod") + grid.NextRow() + + grid.NewLabel("the GUI") + grid.NewLabel("GO plugins for libcurses and GTK") + grid.NextRow() + + grid.NewLabel("") // a stupid way to add padding + grid.NextRow() + + howtoWin.group.NewLabel("Working dir: " + me.forge.GetGoSrc()) + grid = howtoWin.group.RawGrid() + grid.NewButton("Download", func() { + howtoWin.Disable() + defer howtoWin.Enable() + log.Info("download here") + if path, err := fhelp.CheckCmd("go-clone"); err != nil { + log.Info("go-clone missing", path, err) + cmd := []string{"go", "install", "go.wit.com/apps/go-clone@latest"} + shell.RunRealtime(cmd) + } + if path, err := fhelp.CheckCmd("go-clone2"); err != nil { + log.Info("go-clone2 missing", path, err) + } + if path, err := fhelp.CheckCmd("go-clone"); err != nil { + log.Info("can't prep build. you probably need ~/go/bin in your PATH", path, err) + return + } + var cmd []string + if me.forge.IsGoWork() { + cmd = []string{"go-clone", "--work", "--recursive"} + } else { + cmd = []string{"go-clone", "--recursive"} + } + log.Info("Running:", cmd) + shell.RunRealtime(cmd) + + cmd = []string{"go-clone", "--recursive", "go.wit.com/apps/go-mod-clean"} + log.Info("Running:", cmd) + shell.RunRealtime(cmd) + + cmd = []string{"go-clone", "--recursive", "go.wit.com/apps/forge"} + log.Info("Running:", cmd) + shell.RunRealtime(cmd) + + cmd = []string{"go-clone", "--recursive", "go.wit.com/toolkits/gocui"} + log.Info("Running:", cmd) + shell.RunRealtime(cmd) + + cmd = []string{"go-clone", "--recursive", "go.wit.com/toolkits/andlabs"} + log.Info("Running:", cmd) + shell.RunRealtime(cmd) + }) + return howtoWin +} |
