1
0
mirror of https://github.com/beego/bee.git synced 2024-12-21 23:40:49 +00:00

Revert "bak file err"

This reverts commit 0e6ce7dea0.
This commit is contained in:
askuy 2020-07-27 13:11:14 +08:00
parent 3e5f9cf213
commit 6a2f44720e

View File

@ -20,7 +20,7 @@ func (c *RenderFile) write(filename string, buf string) (err error) {
return
}
filePath := filepath.Dir(filename)
filePath := path.Dir(filename)
err = createPath(filePath)
if err != nil {
err = errors.New("write create path " + err.Error())
@ -37,7 +37,7 @@ func (c *RenderFile) write(filename string, buf string) (err error) {
name := path.Base(filename)
if utils.IsExist(filename) {
bakName := fmt.Sprintf("%s/%s.%s.bak", filePathBak, filepath.Base(name), time.Now().Format("2006.01.02.15.04.05"))
bakName := fmt.Sprintf("%s/%s.%s.bak", filePathBak, name, time.Now().Format("2006.01.02.15.04.05"))
beeLogger.Log.Infof("bak file '%s'", bakName)
if err := os.Rename(filename, bakName); err != nil {
err = errors.New("file is bak error, path is " + bakName)