1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

create: Return error on no content dirs

Closes #9056
This commit is contained in:
Bjørn Erik Pedersen
2021-10-19 08:08:21 +02:00
parent e02e0727e5
commit 32c6f656d9

View File

@ -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)