mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-22 03:49:27 +01:00
Expose current git commit
This commit is contained in:
parent
f41067029e
commit
b1a73142b5
@ -45,3 +45,5 @@ archive:
|
||||
- languages/*.md
|
||||
checksum:
|
||||
name_template: "{{ .ProjectName }}-{{ .Version }}-checksums.txt"
|
||||
git:
|
||||
short_hash: true
|
||||
|
@ -13,6 +13,9 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
// Commit is the current git commit.
|
||||
Commit = ""
|
||||
|
||||
// Ver is the full version of Oragono, used in responses to clients.
|
||||
Ver = fmt.Sprintf("oragono-%s", SemVer)
|
||||
|
||||
|
13
oragono.go
13
oragono.go
@ -22,6 +22,8 @@ import (
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
var commit = ""
|
||||
|
||||
func main() {
|
||||
version := irc.SemVer
|
||||
usage := `oragono.
|
||||
@ -98,6 +100,17 @@ Options:
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
if !arguments["--quiet"].(bool) {
|
||||
logman.Info("startup", fmt.Sprintf("Oragono v%s starting", irc.SemVer))
|
||||
if commit == "" {
|
||||
logman.Debug("startup", fmt.Sprintf("Could not get current commit"))
|
||||
} else {
|
||||
logman.Info("startup", fmt.Sprintf("Running commit %s", commit))
|
||||
}
|
||||
}
|
||||
|
||||
// set current git commit
|
||||
irc.Commit = commit
|
||||
if commit != "" {
|
||||
irc.Ver = fmt.Sprintf("%s-%s", irc.Ver, commit)
|
||||
}
|
||||
|
||||
// profiling
|
||||
|
Loading…
Reference in New Issue
Block a user