Skip to content

Commit

Permalink
commands: Add hint when dir not empty
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
YaguraStation authored and bep committed Nov 11, 2019
1 parent 90d0cdf commit 1a36ce9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands/new_site.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 1a36ce9

Please sign in to comment.