5f4fe6d8 by astaxie

fix #260

1 parent 7131dec3
...@@ -154,10 +154,23 @@ func getTplDeep(root, file string, t *template.Template) (*template.Template, [] ...@@ -154,10 +154,23 @@ func getTplDeep(root, file string, t *template.Template) (*template.Template, []
154 if !HasTemplateEXt(m[1]) { 154 if !HasTemplateEXt(m[1]) {
155 continue 155 continue
156 } 156 }
157 t, _, err = getTplDeep(root, m[1], t) 157 if e, _ := FileExists(filepath.Join(root, m[1])); e {
158 if err != nil { 158 t, _, err = getTplDeep(root, m[1], t)
159 return nil, [][]string{}, err 159 if err != nil {
160 return nil, [][]string{}, err
161 }
162 } else {
163 relativefile := filepath.Join(filepath.Dir(file), m[1])
164 if e, _ := FileExists(relativefile); e {
165 t, _, err = getTplDeep(root, m[1], t)
166 if err != nil {
167 return nil, [][]string{}, err
168 }
169 } else {
170 panic("can't find template file" + m[1])
171 }
160 } 172 }
173
161 } 174 }
162 } 175 }
163 return t, allsub, nil 176 return t, allsub, nil
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!