fix something

This commit is contained in:
Jeff Carr 2025-09-09 08:40:49 -05:00
parent 18422baceb
commit 8edefa6dad
3 changed files with 33 additions and 14 deletions

View File

@ -4,9 +4,9 @@ VERSION = $(shell git describe --tags)
DATE = $(shell date +%Y.%m.%d)
run: clean goimports vet install
go-deb --release --no-gui --auto --forge go.wit.com/apps/autogenpb --dir /tmp/
go-deb --release --no-gui --auto --forge go.wit.com/apps/go-mod-clean --dir /tmp/
@#go-deb --forge go.wit.com/apps/autotypist --no-gui --auto
go-deb --release --auto --forge go.wit.com/apps/autogenpb --dir /tmp/
go-deb --release --auto --forge go.wit.com/apps/go-mod-clean --dir /tmp/
@#go-deb --forge go.wit.com/apps/autotypist --auto
ls -lth /tmp/*deb
vet:

View File

@ -13,6 +13,8 @@ import (
type args struct {
Commit *EmptyCmd `arg:"subcommand:commit" help:"'git commit' but errors out if on wrong branch"`
Show *EmptyCmd `arg:"subcommand:show" help:"show what would be done"`
Gui *EmptyCmd `arg:"subcommand:gui" help:"open the gui"`
Auto bool `arg:"--auto" help:"automatically attempt to make the .deb"`
Ldflags []string `arg:"--ldflags" help:"flags to pass to go build"`
Forge string `arg:"--forge" help:"use a git repo from forge"`
@ -54,7 +56,7 @@ func (a args) DoAutoComplete(argv []string) {
default:
if argv[0] == ARGNAME {
// list the subcommands here
fmt.Println("arch build")
fmt.Println("arch build gui show")
}
}
os.Exit(0)

25
main.go
View File

@ -4,8 +4,9 @@ import (
"embed"
"os"
"path/filepath"
"time"
"go.wit.com/gui"
"go.wit.com/dev/alexflint/arg"
"go.wit.com/lib/fhelp"
"go.wit.com/lib/gui/prep"
"go.wit.com/lib/gui/shell"
@ -25,6 +26,9 @@ var argv args
func main() {
me = new(mainType)
prep.Bash(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(argv)
me.myGui = prep.Gui() // prepares the GUI package for go-args
me.pp = arg.MustParse(&argv)
if err := fhelp.ConfigureENV(); err != nil {
badExit(err)
@ -53,8 +57,11 @@ func main() {
log.Info("found repo", me.repo.GetGoPath())
}
// build()
if argv.Show != nil {
log.Info("todo: show", me.repo.GetGoPath())
okExit("")
}
me.myGui = prep.Gui() // prepares the GUI package for go-args
me.basicWindow = makebasicWindow()
// figure out where we are working from
@ -94,10 +101,20 @@ func main() {
os.Exit(0)
}
if argv.Gui != nil {
// only load teh toolkit if you get this far
me.myGui.Start() // loads the GUI toolkit
me.basicWindow.Show()
// go will sit here until the window exits
gui.Watchdog()
debug()
}
log.Info("go-deb: nothing to do in argv")
os.Exit(0)
}
func debug() {
time.Sleep(2 * time.Second)
for {
log.Info("idle loop() todo: could check for things here")
time.Sleep(90 * time.Second)
}
}