markdown: report errors during initial sitegen

This commit is contained in:
Matthew Holt 2015-08-01 13:08:55 -06:00
parent 0ac8bf58ea
commit e63b83c8c4

View File

@ -48,7 +48,8 @@ func Markdown(c *Controller) (middleware.Middleware, error) {
}
fp := filepath.Join(md.Root, cfg.PathScope)
filepath.Walk(fp, func(path string, info os.FileInfo, err error) error {
err = filepath.Walk(fp, func(path string, info os.FileInfo, err error) error {
for _, ext := range cfg.Extensions {
if !info.IsDir() && strings.HasSuffix(info.Name(), ext) {
// Load the file
@ -75,9 +76,12 @@ func Markdown(c *Controller) (middleware.Middleware, error) {
break // don't try other file extensions
}
}
return nil
})
if err != nil {
return err
}
}
return nil