summaryrefslogtreecommitdiffstats
path: root/create
diff options
context:
space:
mode:
Diffstat (limited to 'create')
-rw-r--r--create/content.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/create/content.go b/create/content.go
index f7c343d42..db07720ad 100644
--- a/create/content.go
+++ b/create/content.go
@@ -82,11 +82,13 @@ func NewContent(h *hugolib.HugoSites, kind, targetPath string, force bool) error
b.setArcheTypeFilenameToUse(ext)
withBuildLock := func() (string, error) {
- unlock, err := h.BaseFs.LockBuild()
- if err != nil {
- return "", fmt.Errorf("failed to acquire a build lock: %s", err)
+ if !h.Configs.Base.NoBuildLock {
+ unlock, err := h.BaseFs.LockBuild()
+ if err != nil {
+ return "", fmt.Errorf("failed to acquire a build lock: %s", err)
+ }
+ defer unlock()
}
- defer unlock()
if b.isDir {
return "", b.buildDir()