2020-05-21 17:25:30 +02:00
|
|
|
// Copyright (c) 2020 Shivaram Lingamneni
|
|
|
|
// Released under the MIT license
|
|
|
|
|
|
|
|
package irc
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
const (
|
2021-05-25 06:34:38 +02:00
|
|
|
// SemVer is the semantic version of Ergo.
|
2024-06-09 09:11:33 +02:00
|
|
|
SemVer = "2.14.0-rc1"
|
2020-05-21 17:25:30 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2021-05-25 06:34:38 +02:00
|
|
|
// Ver is the full version of Ergo, used in responses to clients.
|
|
|
|
Ver = fmt.Sprintf("ergo-%s", SemVer)
|
2020-05-21 17:25:30 +02:00
|
|
|
// Commit is the full git hash, if available
|
|
|
|
Commit string
|
|
|
|
)
|
|
|
|
|
|
|
|
// initialize version strings (these are set in package main via linker flags)
|
|
|
|
func SetVersionString(version, commit string) {
|
|
|
|
Commit = commit
|
|
|
|
if version != "" {
|
2021-05-25 06:34:38 +02:00
|
|
|
Ver = fmt.Sprintf("ergo-%s", version)
|
2020-05-21 17:25:30 +02:00
|
|
|
} else if len(Commit) == 40 {
|
2021-05-25 06:34:38 +02:00
|
|
|
Ver = fmt.Sprintf("ergo-%s-%s", SemVer, Commit[:16])
|
2020-05-21 17:25:30 +02:00
|
|
|
}
|
|
|
|
}
|