summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-14 01:04:31 -0600
committerJeff Carr <[email protected]>2024-02-14 01:04:31 -0600
commit21c79d03ecabc7dcdbaa7ab4f342c6dd1443d7e2 (patch)
tree72a0dbb9f871b11e85693e92a6cd84d7fdbf56c5
parent92da6ff17791f5eadc77b9276a2d0b70dac43dbd (diff)
use env vars for versions
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--globalDisplayOptions.go1
-rw-r--r--main.go28
2 files changed, 26 insertions, 3 deletions
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