Minor code fix [CI SKIP]

This commit is contained in:
Unknwon committed 2016-08-31 04:31:53 -07:00
1 parent 152e715999
commit c2afdf2192
3 files changed
+10 -4

No files matched your search

+7 -2
View File
@@ -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.