Minor code fix [CI SKIP]

This commit is contained in:
Unknwon 2016-08-31 04:31:53 -07:00
parent 152e715999
commit c2afdf2192
3 changed files with 10 additions and 4 deletions

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.