From c2afdf2192b9f0287968e29160e30a45a3ff1339 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 31 Aug 2016 04:31:53 -0700 Subject: Minor code fix [CI SKIP] --- cmd/web.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/web.go b/cmd/web.go index d92b66d8..d760decf 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. -- cgit v1.2.3