Commit 5f4fe6d8 authored by astaxie's avatar astaxie

fix #260

parent 7131dec3
......@@ -154,10 +154,23 @@ func getTplDeep(root, file string, t *template.Template) (*template.Template, []
if !HasTemplateEXt(m[1]) {
continue
}
t, _, err = getTplDeep(root, m[1], t)
if err != nil {
return nil, [][]string{}, err
if e, _ := FileExists(filepath.Join(root, m[1])); e {
t, _, err = getTplDeep(root, m[1], t)
if err != nil {
return nil, [][]string{}, err
}
} else {
relativefile := filepath.Join(filepath.Dir(file), m[1])
if e, _ := FileExists(relativefile); e {
t, _, err = getTplDeep(root, m[1], t)
if err != nil {
return nil, [][]string{}, err
}
} else {
panic("can't find template file" + m[1])
}
}
}
}
return t, allsub, nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment