3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-14 07:59:31 +01:00

Expose current git commit

This commit is contained in:
Daniel Oaks 2018-04-09 10:08:54 +10:00
parent f41067029e
commit b1a73142b5
3 changed files with 18 additions and 0 deletions

View File

@ -45,3 +45,5 @@ archive:
- languages/*.md - languages/*.md
checksum: checksum:
name_template: "{{ .ProjectName }}-{{ .Version }}-checksums.txt" name_template: "{{ .ProjectName }}-{{ .Version }}-checksums.txt"
git:
short_hash: true

View File

@ -13,6 +13,9 @@ const (
) )
var ( var (
// Commit is the current git commit.
Commit = ""
// Ver is the full version of Oragono, used in responses to clients. // Ver is the full version of Oragono, used in responses to clients.
Ver = fmt.Sprintf("oragono-%s", SemVer) Ver = fmt.Sprintf("oragono-%s", SemVer)

View File

@ -22,6 +22,8 @@ import (
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
) )
var commit = ""
func main() { func main() {
version := irc.SemVer version := irc.SemVer
usage := `oragono. usage := `oragono.
@ -98,6 +100,17 @@ Options:
rand.Seed(time.Now().UTC().UnixNano()) rand.Seed(time.Now().UTC().UnixNano())
if !arguments["--quiet"].(bool) { if !arguments["--quiet"].(bool) {
logman.Info("startup", fmt.Sprintf("Oragono v%s starting", irc.SemVer)) 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 // profiling