aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-04-03 00:10:11 +0800
committertechknowlogick <matti@mdranta.net>2019-04-02 12:10:11 -0400
commit0a8e63c68292a08d8a7bc4fa397ae41235f086a7 (patch)
tree89a1d88237a8aed1d68cb9f951878f72bf95ea07 /main.go
parent60ba903a57f8ac6f40ba6e10d03f2e23acc7c2c3 (diff)
downloadgitea-0a8e63c68292a08d8a7bc4fa397ae41235f086a7.tar.gz
gitea-0a8e63c68292a08d8a7bc4fa397ae41235f086a7.zip
add make version on gitea version (#6485)
Diffstat (limited to 'main.go')
-rw-r--r--main.go23
1 files changed, 15 insertions, 8 deletions
diff --git a/main.go b/main.go
index dfa7629e13..989ae1c58c 100644
--- a/main.go
+++ b/main.go
@@ -23,11 +23,14 @@ import (
"github.com/urfave/cli"
)
-// Version holds the current Gitea version
-var Version = "1.5.0-dev"
-
-// Tags holds the build tags used
-var Tags = ""
+var (
+ // Version holds the current Gitea version
+ Version = "1.9.0-dev"
+ // Tags holds the build tags used
+ Tags = ""
+ // MakeVersion holds the current Make version if built with make
+ MakeVersion = ""
+)
func init() {
setting.AppVer = Version
@@ -60,10 +63,14 @@ arguments - which can alternatively be run by running the subcommand web.`
}
}
-func formatBuiltWith(Tags string) string {
+func formatBuiltWith(makeTags string) string {
+ var version = runtime.Version()
+ if len(MakeVersion) > 0 {
+ version = MakeVersion + ", " + runtime.Version()
+ }
if len(Tags) == 0 {
- return " built with " + runtime.Version()
+ return " built with " + version
}
- return " built with " + runtime.Version() + " : " + strings.Replace(Tags, " ", ", ", -1)
+ return " built with " + version + " : " + strings.Replace(Tags, " ", ", ", -1)
}