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:
parent
f41067029e
commit
b1a73142b5
@ -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
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
13
oragono.go
13
oragono.go
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user