aboutsummaryrefslogtreecommitdiffstats
path: root/modules/templates
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-12-22 07:40:57 +0800
committerGitHub <noreply@github.com>2020-12-22 07:40:57 +0800
commitacd5e5a868c2c158132b4017f318943d1e6c573f (patch)
treed7e440a5add88a6779f605c82fa6e9085ebd424d /modules/templates
parentf8fd8996c090a02fe482587ccf03a319459fc704 (diff)
downloadgitea-acd5e5a868c2c158132b4017f318943d1e6c573f.tar.gz
gitea-acd5e5a868c2c158132b4017f318943d1e6c573f.zip
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>
Diffstat (limited to 'modules/templates')
-rw-r--r--modules/templates/dynamic.go5
-rw-r--r--modules/templates/static.go5
2 files changed, 4 insertions, 6 deletions
diff --git a/modules/templates/dynamic.go b/modules/templates/dynamic.go
index 5eda948034..7f1a36e0b7 100644
--- a/modules/templates/dynamic.go
+++ b/modules/templates/dynamic.go
@@ -18,7 +18,6 @@ import (
"code.gitea.io/gitea/modules/util"
"gitea.com/macaron/macaron"
- "github.com/unknwon/com"
)
var (
@@ -65,7 +64,7 @@ func Mailer() (*texttmpl.Template, *template.Template) {
log.Warn("Unable to check if templates dir %s is a directory. Error: %v", staticDir, err)
}
if isDir {
- files, err := com.StatDir(staticDir)
+ files, err := util.StatDir(staticDir)
if err != nil {
log.Warn("Failed to read %s templates dir. %v", staticDir, err)
@@ -94,7 +93,7 @@ func Mailer() (*texttmpl.Template, *template.Template) {
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)
diff --git a/modules/templates/static.go b/modules/templates/static.go
index fd8e79a783..0c3d65ccf2 100644
--- a/modules/templates/static.go
+++ b/modules/templates/static.go
@@ -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)