quintodrome/consts/banner.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
406 B
Go
Raw Normal View History

package consts
2020-01-25 07:06:04 -09:00
import (
"fmt"
"strings"
2020-03-18 19:21:01 -08:00
"unicode"
2020-01-25 07:06:04 -09:00
"github.com/deluan/navidrome/resources"
2020-01-25 07:06:04 -09:00
)
func getBanner() string {
data, _ := resources.Asset("banner.txt")
2020-03-18 19:21:01 -08:00
return strings.TrimRightFunc(string(data), unicode.IsSpace)
2020-01-25 07:06:04 -09:00
}
func Banner() string {
version := "Version: " + Version()
2020-01-25 07:06:04 -09:00
padding := strings.Repeat(" ", 52-len(version))
2020-03-18 19:21:01 -08:00
return fmt.Sprintf("%s\n%s%s\n", getBanner(), padding, version)
2020-01-25 07:06:04 -09:00
}