summaryrefslogtreecommitdiff
path: root/stateWindow.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-20 23:13:26 -0600
committerJeff Carr <[email protected]>2024-02-20 23:13:26 -0600
commit38b1ecab60974813ecf8d64685f2992152b3edf9 (patch)
treeee9cd7c32ceec1cf49ac86447a921ae1ced1a972 /stateWindow.go
parentc9f149bcb2ad96f08f3464639517e48a5c3cbdde (diff)
add --release builds
Diffstat (limited to 'stateWindow.go')
-rw-r--r--stateWindow.go30
1 files changed, 22 insertions, 8 deletions
diff --git a/stateWindow.go b/stateWindow.go
index 142c8b7..cb03e01 100644
--- a/stateWindow.go
+++ b/stateWindow.go
@@ -60,14 +60,27 @@ func makebasicWindow() *gadgets.BasicWindow {
func (c *controlBox) buildPackage() bool {
// TODO: if dirty, set GO111MODULE
// also, if last tag != version
- if c.status.CheckDirty() {
- os.Setenv("GO111MODULE", "off")
- }
- if shell.Run([]string{"go", "build", "-v", "-x"}) {
- log.Warn("build worked")
+ if args.Release {
+ os.Unsetenv("GO111MODULE")
+ path := c.pathL.String() + "@latest"
+ cmd := []string{"go", "install", "-v", "-x", path}
+ if shell.Run(cmd) {
+ log.Warn("build worked")
+ } else {
+ log.Warn("build failed")
+ return false
+ }
} else {
- log.Warn("build failed")
- return false
+
+ if c.status.CheckDirty() {
+ os.Setenv("GO111MODULE", "off")
+ }
+ if shell.Run([]string{"go", "build", "-v", "-x"}) {
+ log.Warn("build worked")
+ } else {
+ log.Warn("build failed")
+ return false
+ }
}
filename := c.Package.String()
@@ -212,7 +225,8 @@ func (c *controlBox) computeControlValues() bool {
// TODO: get this from gitea (or gitlab or github, etc)
// or from the README.md ?
if c.Description.String() == "" {
- c.Description.SetText("missing control file")
+ path := c.pathL.String()
+ c.Description.SetText("GO binary of " + path)
}
return true
}