summaryrefslogtreecommitdiffstats
path: root/cmd/web.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-31 04:31:53 -0700
committerUnknwon <u@gogs.io>2016-08-31 04:31:53 -0700
commitc2afdf2192b9f0287968e29160e30a45a3ff1339 (patch)
tree6c26bc64e7dd14b88f0320592e8d6cf55b7a40fc /cmd/web.go
parent152e715999bfec9859423034aec3df90442961f1 (diff)
downloadgitea-c2afdf2192b9f0287968e29160e30a45a3ff1339.tar.gz
gitea-c2afdf2192b9f0287968e29160e30a45a3ff1339.zip
Minor code fix [CI SKIP]
Diffstat (limited to 'cmd/web.go')
-rw-r--r--cmd/web.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/web.go b/cmd/web.go
index d92b66d8b6..d760decf5e 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -73,8 +73,13 @@ func checkVersion() {
if err != nil {
log.Fatal(4, "Fail to read 'templates/.VERSION': %v", err)
}
- if string(data) != setting.AppVer {
- log.Fatal(4, "Binary and template file version does not match, did you forget to recompile?")
+ tplVer := string(data)
+ if tplVer != setting.AppVer {
+ if version.Compare(tplVer, setting.AppVer, ">") {
+ log.Fatal(4, "Binary version is lower than template file version, did you forget to recompile Gogs?")
+ } else {
+ log.Fatal(4, "Binary version is higher than template file version, did you forget to update template files?")
+ }
}
// Check dependency version.