diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-28 00:06:31 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-28 00:06:31 -0400 |
commit | ff690fd9760e0cfb5ae9e49aecb7a201f7ca8304 (patch) | |
tree | 3e601c42e1fc8ff50df02bf04fb48680a031123e /cmd/web.go | |
parent | bcfa78b8b559c638c40fa9d0c4ff08c6d8307e88 (diff) | |
download | gitea-ff690fd9760e0cfb5ae9e49aecb7a201f7ca8304.tar.gz gitea-ff690fd9760e0cfb5ae9e49aecb7a201f7ca8304.zip |
Fix #200, add VERSION to template files
Diffstat (limited to 'cmd/web.go')
-rw-r--r-- | cmd/web.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/web.go b/cmd/web.go index f4b31dcd5d..d8d9785f35 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -7,6 +7,7 @@ package cmd import ( "fmt" "html/template" + "io/ioutil" "net/http" "os" "path" @@ -18,7 +19,6 @@ 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" @@ -40,12 +40,11 @@ and it takes care of all the other things for you`, Flags: []cli.Flag{}, } +// checkVersion checks if binary matches the version of temolate files. 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") + data, err := ioutil.ReadFile(path.Join(setting.StaticRootPath, "templates/VERSION")) if err != nil { - log.Fatal("Fail to read 'conf/VERSION': %v", err) + log.Fatal("Fail to read 'templates/VERSION': %v", err) } if string(data) != setting.AppVer { log.Fatal("Binary and static file version does not match, did you forget to recompile?") |