0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-27 23:03:37 -05:00

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