fix: version position under banner

This commit is contained in:
Deluan 2020-03-18 23:21:01 -04:00
parent 8b108905a3
commit cbbebb3264

View file

@ -3,17 +3,18 @@ package consts
import ( import (
"fmt" "fmt"
"strings" "strings"
"unicode"
"github.com/deluan/navidrome/static" "github.com/deluan/navidrome/static"
) )
func getBanner() string { func getBanner() string {
data, _ := static.Asset("banner.txt") data, _ := static.Asset("banner.txt")
return strings.TrimSuffix(string(data), "\n") return strings.TrimRightFunc(string(data), unicode.IsSpace)
} }
func Banner() string { func Banner() string {
version := "Version: " + Version() version := "Version: " + Version()
padding := strings.Repeat(" ", 52-len(version)) padding := strings.Repeat(" ", 52-len(version))
return fmt.Sprintf("%s%s%s\n", getBanner(), padding, version) return fmt.Sprintf("%s\n%s%s\n", getBanner(), padding, version)
} }