fix when delete the commentsRouter.go

This commit is contained in:
astaxie 2014-08-04 17:39:14 +08:00
commit f4147058fc
2 changed files with 4 additions and 1 deletions

2
cache/cache.go vendored
View File

@ -16,7 +16,7 @@ import (
// Cache interface contains all behaviors for cache adapter.
// usage:
// cache.Register("file",cache.NewFileCache()) // this operation is run in init method of file.go.
// c := cache.NewCache("file","{....}")
// c,err := cache.NewCache("file","{....}")
// c.Put("key",value,3600)
// v := c.Get("key")
//

View File

@ -158,6 +158,9 @@ func genRouterCode() {
}
func compareFile(pkgRealpath string) bool {
if !utils.FileExists(path.Join(workPath, "routers", "commentsRouter.go")) {
return true
}
if utils.FileExists(path.Join(workPath, lastupdateFilename)) {
content, err := ioutil.ReadFile(path.Join(workPath, lastupdateFilename))
if err != nil {