mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-18 21:07:44 +03:00
Strip 'v' prefix from version, to make it consistent for release and snapshot
This commit is contained in:
parent
167fca86d0
commit
f28e8118dc
@ -1,6 +1,9 @@
|
|||||||
package consts
|
package consts
|
||||||
|
|
||||||
import "fmt"
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// This will be set in build time. If not, version will be set to "dev"
|
// This will be set in build time. If not, version will be set to "dev"
|
||||||
@ -11,10 +14,12 @@ var (
|
|||||||
// Formats:
|
// Formats:
|
||||||
// dev
|
// dev
|
||||||
// v0.2.0 (5b84188)
|
// v0.2.0 (5b84188)
|
||||||
|
// v0.3.2-SNAPSHOT (715f552)
|
||||||
// master (9ed35cb)
|
// master (9ed35cb)
|
||||||
func Version() string {
|
func Version() string {
|
||||||
if gitSha == "" {
|
if gitSha == "" {
|
||||||
return "dev"
|
return "dev"
|
||||||
}
|
}
|
||||||
|
gitTag = strings.TrimPrefix(gitTag, "v")
|
||||||
return fmt.Sprintf("%s (%s)", gitTag, gitSha)
|
return fmt.Sprintf("%s (%s)", gitTag, gitSha)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user