Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-10-19 09:08:21 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-10-19 09:08:21 +0300
commit32c6f656d93ecf4308f7c30848b13b4c6f157436 (patch)
tree4b682e7b8b598d5d429928bc39e46736f044561f /create/content.go
parente02e0727e57f123f9a8de506e9c098bb374f7a23 (diff)
create: Return error on no content dirs
Closes #9056
Diffstat (limited to 'create/content.go')
-rw-r--r--create/content.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/create/content.go b/create/content.go
index b006e0f2c..7f444f9df 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)