Add StatDir and replace com.StatDir (#14099)

* Add StatDir and replace com.StatDir

* a nit

* Remove wrong file

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Lunny Xiao 2020-12-22 07:40:57 +08:00 committed by GitHub
parent f8fd8996c0
commit acd5e5a868
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 88 additions and 14 deletions

View file

@ -21,7 +21,6 @@ import (
"code.gitea.io/gitea/modules/util"
"gitea.com/macaron/macaron"
"github.com/unknwon/com"
)
var (
@ -83,7 +82,7 @@ func NewTemplateFileSystem() templateFileSystem {
log.Warn("Unable to check if templates dir %s is a directory. Error: %v", customDir, err)
}
if isDir {
files, err := com.StatDir(customDir)
files, err := util.StatDir(customDir)
if err != nil {
log.Warn("Failed to read %s templates dir. %v", customDir, err)
@ -179,7 +178,7 @@ func Mailer() (*texttmpl.Template, *template.Template) {
log.Warn("Failed to check if custom directory %s is a directory. %v", err)
}
if isDir {
files, err := com.StatDir(customDir)
files, err := util.StatDir(customDir)
if err != nil {
log.Warn("Failed to read %s templates dir. %v", customDir, err)