Better error message when no source content is found.
authorspf13 <steve.francia@gmail.com>
Sun, 29 Sep 2013 06:07:05 +0000 (02:07 -0400)
committerspf13 <steve.francia@gmail.com>
Sun, 29 Sep 2013 06:10:29 +0000 (02:10 -0400)
hugolib/site.go

index 2e16094b9fb88cb122feec765d88874501f1c9fe..58f770d5a2521e7d1069abb45ca269e58214e16a 100644 (file)
@@ -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 {