diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go index 7439e4c..4c57c99 100644 --- a/globalDisplayOptions.go +++ b/globalDisplayOptions.go @@ -152,6 +152,7 @@ func globalDisplayOptions(box *gui.Node) { } } log.Info("redo go.sum finished ok!") + longB.Disable() me.Enable() longB.Enable() }) diff --git a/main.go b/main.go index 5a1d6e4..c9edfd3 100644 --- a/main.go +++ b/main.go @@ -3,17 +3,20 @@ package main import ( "embed" "fmt" + "os" + "path/filepath" "strings" "time" "go.wit.com/gui" + "go.wit.com/lib/gui/shell" "go.wit.com/log" ) // TODO: autocompute these in the gui -var releaseReasonS string = "deb packager" -var releaseVersion string = "0.20.3" -var widgetVersion string = "1.1.18" +var releaseReasonS string +var releaseVersion string +var widgetVersion string //go:embed resources/* var resToolkit embed.FS @@ -22,6 +25,16 @@ func main() { me = new(autoType) me.allrepos = make(map[string]*repo) + // TODO: autocompute these in the gui + releaseReasonS = os.Getenv("GUIRELEASE_REASON") + releaseVersion = os.Getenv("GUIRELEASE_VERSION") + widgetVersion = os.Getenv("GUIRELEASE_WIDGET") + + if releaseVersion == "" { + log.Info("GUIRELEASE_VERSION not set") + os.Exit(0) + } + me.myGui = gui.New() me.myGui.InitEmbed(resToolkit) me.myGui.Default() @@ -31,6 +44,15 @@ func main() { globalDisplayOptions(me.mainBox) + // if you have a go.work file, you must delete it + // TODO: check for go.work files anywhere + homeDir, _ := os.UserHomeDir() + gowork := filepath.Join(homeDir, "go/src/go.work") + if shell.Exists(gowork) { + log.Info("go.work must be deleted") + os.Exit(0) + } + repoworld() me.releaseReasonS = releaseReasonS