mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
refactor: move banner to consts, closer to version
This commit is contained in:
parent
0996272943
commit
d1f8d39866
2 changed files with 6 additions and 6 deletions
|
@ -1,10 +1,9 @@
|
|||
package main
|
||||
package consts
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/deluan/navidrome/consts"
|
||||
"github.com/deluan/navidrome/static"
|
||||
)
|
||||
|
||||
|
@ -13,8 +12,8 @@ func getBanner() string {
|
|||
return strings.TrimSuffix(string(data), "\n")
|
||||
}
|
||||
|
||||
func ShowBanner() {
|
||||
version := "Version: " + consts.Version()
|
||||
func Banner() string {
|
||||
version := "Version: " + Version()
|
||||
padding := strings.Repeat(" ", 52-len(version))
|
||||
fmt.Printf("%s%s%s\n\n", getBanner(), padding, version)
|
||||
return fmt.Sprintf("%s%s%s\n", getBanner(), padding, version)
|
||||
}
|
3
main.go
3
main.go
|
@ -2,12 +2,13 @@ package main
|
|||
|
||||
import (
|
||||
"github.com/deluan/navidrome/conf"
|
||||
"github.com/deluan/navidrome/consts"
|
||||
"github.com/deluan/navidrome/db"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if !conf.Server.DevDisableBanner {
|
||||
ShowBanner()
|
||||
println(consts.Banner())
|
||||
}
|
||||
|
||||
conf.Load()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue