diff options
Diffstat (limited to 'cmd/web.go')
-rw-r--r-- | cmd/web.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/web.go b/cmd/web.go index 2019b4405d..f4b31dcd5d 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -18,6 +18,7 @@ import ( "github.com/gogits/gogs/modules/auth/apiv1" "github.com/gogits/gogs/modules/avatar" "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/bin" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/modules/middleware/binding" @@ -39,6 +40,18 @@ and it takes care of all the other things for you`, Flags: []cli.Flag{}, } +func checkVersion() { + // go-bindata -ignore=\\.DS_Store -o modules/bin/conf.go -pkg="bin" conf/... + // Check if binary and static file version match. + data, err := bin.Asset("conf/VERSION") + if err != nil { + log.Fatal("Fail to read 'conf/VERSION': %v", err) + } + if string(data) != setting.AppVer { + log.Fatal("Binary and static file version does not match, did you forget to recompile?") + } +} + func newMartini() *martini.ClassicMartini { r := martini.NewRouter() m := martini.New() @@ -52,6 +65,7 @@ func newMartini() *martini.ClassicMartini { } func runWeb(*cli.Context) { + checkVersion() routers.GlobalInit() m := newMartini() |