quintodrome/resources/banner.go

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

25 lines
418 B
Go
Raw Normal View History

package resources
2020-01-25 07:06:04 -09:00
import (
"fmt"
2024-02-03 08:05:03 -09:00
"io"
2020-01-25 07:06:04 -09:00
"strings"
2020-03-18 19:21:01 -08:00
"unicode"
2020-01-25 07:06:04 -09:00
"github.com/navidrome/navidrome/consts"
2020-01-25 07:06:04 -09:00
)
2021-07-20 14:43:15 -08:00
func loadBanner() string {
2024-02-03 08:05:03 -09:00
f, err := embedFS.Open("banner.txt")
if err != nil {
return ""
}
data, _ := io.ReadAll(f)
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 {
2022-09-14 17:09:39 -08:00
version := "Version: " + consts.Version
2021-07-20 14:43:15 -08:00
return fmt.Sprintf("%s\n%52s\n", loadBanner(), version)
2020-01-25 07:06:04 -09:00
}