Skip to content

Commit

Permalink
create: Return error on no content dirs
Browse files Browse the repository at this point in the history
Closes #9056
  • Loading branch information
bep committed Oct 19, 2021
1 parent e02e072 commit 32c6f65
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions create/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ draft: true
// NewContent creates a new content file in h (or a full bundle if the archetype is a directory)
// in targetPath.
func NewContent(h *hugolib.HugoSites, kind, targetPath string) error {
if h.BaseFs.Content.Dirs == nil {
return errors.New("no existing content directory configured for this project")
}
unlock, err := h.BaseFs.LockBuild()
if err != nil {
return fmt.Errorf("failed to acquire a build lock: %s", err)
Expand Down

0 comments on commit 32c6f65

Please sign in to comment.