summaryrefslogtreecommitdiffstats
path: root/modules/templates/static.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/templates/static.go')
-rw-r--r--modules/templates/static.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/templates/static.go b/modules/templates/static.go
index 435ccb1f95..5bc4e33e1c 100644
--- a/modules/templates/static.go
+++ b/modules/templates/static.go
@@ -229,3 +229,16 @@ func AssetNames() []string {
}
return results
}
+
+func AssetIsDir(name string) (bool, error) {
+ if f, err := Assets.Open("/" + name); err != nil {
+ return false, err
+ } else {
+ defer f.Close()
+ if fi, err := f.Stat(); err != nil {
+ return false, err
+ } else {
+ return fi.IsDir(), nil
+ }
+ }
+}