shithub: hugo

Download patch

ref: 1a36ce9b0903e02a5068aed5f807ed9d21f48ece
parent: 90d0cdf236b54000bfe444ba3a00236faaa28790
author: reuben honigwachs <reuben@honigwachs.de>
date: Mon Nov 11 17:38:10 EST 2019

commands: Add hint when dir not empty

Many users seem to stumble over creating new sites in existing non-empty directories. And that `--force` is the necessary option. So I added *See --force* as a hint to the error.

Fixes #4825.

--- a/commands/new_site.go
+++ b/commands/new_site.go
@@ -81,7 +81,7 @@
 
 		switch {
 		case !isEmpty && !force:
-			return errors.New(basepath + " already exists and is not empty")
+			return errors.New(basepath + " already exists and is not empty. See --force.")
 
 		case !isEmpty && force:
 			all := append(dirs, filepath.Join(basepath, "config."+n.configFormat))