mirror of
https://github.com/kataras/iris.git
synced 2026-01-04 10:47:20 +00:00
minor (see prev commit)
This commit is contained in:
@@ -226,6 +226,8 @@ func (l *jetLoader) Exists(name string) bool {
|
||||
|
||||
// Load should load the templates from a physical system directory or by an embedded one (assets/go-bindata).
|
||||
func (s *JetEngine) Load() error {
|
||||
rootDirName := getRootDirName(s.fs)
|
||||
|
||||
return walk(s.fs, "", func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -241,6 +243,11 @@ func (s *JetEngine) Load() error {
|
||||
}
|
||||
}
|
||||
|
||||
if s.rootDir == rootDirName {
|
||||
path = strings.TrimPrefix(path, rootDirName)
|
||||
path = strings.TrimPrefix(path, "/")
|
||||
}
|
||||
|
||||
buf, err := asset(s.fs, path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s: %w", path, err)
|
||||
|
||||
Reference in New Issue
Block a user