From: Bjørn Erik Pedersen Date: Tue, 19 Oct 2021 06:08:21 +0000 (+0200) Subject: create: Return error on no content dirs X-Git-Tag: v0.89.0~31 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=32c6f656d93ecf4308f7c30848b13b4c6f157436;p=brevno-suite%2Fhugo create: Return error on no content dirs Closes #9056 --- diff --git a/create/content.go b/create/content.go index b006e0f2..7f444f9d 100644 --- a/create/content.go +++ b/create/content.go @@ -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)