From: spf13 Date: Sun, 29 Sep 2013 06:07:05 +0000 (-0400) Subject: Better error message when no source content is found. X-Git-Tag: v0.9~84 X-Git-Url: http://git.maquefel.me//?a=commitdiff_plain;h=ff2b98c9dd23d0b0bcc6d0a961f373911eee6bef;p=brevno-suite%2Fhugo Better error message when no source content is found. --- diff --git a/hugolib/site.go b/hugolib/site.go index 2e16094b..58f770d5 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -247,6 +247,12 @@ func (s *Site) ProcessShortcodes() { } func (s *Site) CreatePages() (err error) { + if s.Source == nil { + return fmt.Errorf("No source files found in", s.absContentDir()) + } + if len(s.Source.Files()) < 1 { + return fmt.Errorf("No source files found in", s.absContentDir()) + } for _, file := range s.Source.Files() { page, err := ReadFrom(file.Contents, file.LogicalName) if err != nil {