commands: Add hint when dir not empty
authorreuben honigwachs <reuben@honigwachs.de>
Mon, 11 Nov 2019 20:38:10 +0000 (22:38 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 11 Nov 2019 20:38:10 +0000 (21:38 +0100)
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.

commands/new_site.go

index 6d1677e22d6790ba2bb8871f3de0539e0141fc62..f884a6433f18f42f10a4f2691c0e852bbfc491b8 100644 (file)
@@ -81,7 +81,7 @@ func (n *newSiteCmd) doNewSite(fs *hugofs.Fs, basepath string, force bool) error
 
                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))