diff --git a/config.go b/config.go index 0c087f4..54882c2 100644 --- a/config.go +++ b/config.go @@ -30,10 +30,11 @@ func getConfig() *config.Config { flag.Parse() if showVersion { - if version.Version == "" { - version.Version = "development" + v := version.Version + if v == "" { + v = "development" } - fmt.Printf("Aminal %s\n", version.Version) + fmt.Println(v) os.Exit(0) } diff --git a/gui/gui.go b/gui/gui.go index 4a79bf4..55eaeff 100644 --- a/gui/gui.go +++ b/gui/gui.go @@ -197,6 +197,7 @@ func (gui *GUI) Render() error { r, err := version.GetNewerRelease() if err == nil && r != nil { latestVersion = r.TagName + gui.terminal.SetDirty() } }() @@ -289,9 +290,19 @@ Buffer Size: %d lines ) } - if latestVersion != "" && time.Since(startTime) < time.Second*10 { + if latestVersion != "" && time.Since(startTime) < time.Second*10 && gui.terminal.ActiveBuffer().RawLine() == 0 { + time.AfterFunc(time.Second, gui.terminal.SetDirty) _, h := gui.terminal.GetSize() - gui.textbox(2, uint16(h-3), fmt.Sprintf("Version %s of Aminal is now available.", strings.Replace(latestVersion, "v", "", -1)), + var msg string + if version.Version == "" { + msg = "You are using a development build of Aminal." + } else { + msg = fmt.Sprintf("Version %s of Aminal is now available.", strings.Replace(latestVersion, "v", "", -1)) + } + gui.textbox( + 2, + uint16(h-3), + fmt.Sprintf("%s (%d)", msg, 10-int(time.Since(startTime).Seconds())), [3]float32{1, 1, 1}, [3]float32{0, 0.5, 0}, ) diff --git a/scripts/package-debian.sh b/scripts/package-debian.sh index 21dace9..2d4d8bf 100755 --- a/scripts/package-debian.sh +++ b/scripts/package-debian.sh @@ -32,4 +32,5 @@ dpkg-deb --build package rm -rf package mkdir -p bin/debian -mv package.deb bin/debian/${BINARYFILE}.deb +FN=$(basename "${BINARYFILE}") +mv package.deb bin/debian/${FN}.deb