From 455637d05718f7501b580db7852e1acc521b7c83 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 4 Oct 2025 03:52:52 -0500 Subject: add an auto-run option --- argv.go | 3 ++- main.go | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/argv.go b/argv.go index cb952ce..244d53a 100644 --- a/argv.go +++ b/argv.go @@ -21,6 +21,7 @@ type args struct { Full bool `arg:"--full" help:"build every package"` Reason string `arg:"--reason" help:"tag message"` Force bool `arg:"--force" help:"try harder than normal"` + AutoRun bool `arg:"--auto-run" help:"automatically process everything"` Port int `arg:"--port" default:"9419" help:"do fun stuff with curl"` } @@ -66,7 +67,7 @@ func (args) Buildtime() (string, string) { func (a args) DoAutoComplete(pb *prep.Auto) { if pb.Cmd == "" { - pb.Autocomplete3([]string{"--bash", "quick", "--dry-run", "--full", "--reason", "--version"}) + pb.Autocomplete3([]string{"--bash", "quick", "--dry-run", "--full", "--reason", "--version", "--auto-run"}) } else { pb.SubCommand(pb.Goargs...) } diff --git a/main.go b/main.go index 49b02cb..a6c1506 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "fmt" "os" "path/filepath" + "time" "go.wit.com/lib/fhelp" "go.wit.com/lib/gadgets" @@ -125,6 +126,17 @@ func main() { me.Enable() me.release.box.Enable() + if argv.AutoRun { + go startHTTP() + log.Info("Attempt to auto-run here. sleep 5") + time.Sleep(5 * time.Second) + + buttonDisable() + doReleaseAll() + buttonEnable() + for { + } + } // start the http server for polling status startHTTP() } -- cgit v1.2.3