Fix ldflags version

pull/49/head
Miguel Mota 5 years ago
parent c9211b53fd
commit 6f286490be

@ -7,4 +7,4 @@ builds:
goarch:
- amd64
ldflags:
- -X main.version={{.Env.VERSION}}
- -X github.com/miguelmota/cointop/cointop.version={{.Env.VERSION}}

@ -56,7 +56,12 @@ func (ct *Cointop) updateStatusbar(s string) error {
base := fmt.Sprintf("%s%s %sHelp %sChart %sRange %sSearch %sConvert %s %s %sSave", "[Q]", quitText, "[?]", "[Enter]", "[[ ]]", "[/]", "[C]", favoritesText, portfolioText, "[CTRL-S]")
str := pad.Right(fmt.Sprintf("%v %sPage %v/%v %s", base, "[← →]", currpage, totalpages, s), ct.maxTableWidth, " ")
v := fmt.Sprintf("v%s", ct.Version())
str = str[:len(str)-len(v)+2] + v
end := len(str) - len(v) + 2
if end > len(str) {
end = len(str)
}
str = str[:end] + v
ct.update(func() {
ct.Views.Statusbar.Update(str)

@ -6,7 +6,7 @@ import (
)
// version is the cointop version which will be populated by ldflags
var version string
var version = "dev"
// Version returns the cointop version
func (ct *Cointop) Version() string {

Loading…
Cancel
Save