add option for #106

This commit is contained in:
Henrique Dias
2017-04-15 16:14:08 +01:00
parent 55f4b75529
commit 6ef2cf88e0
2 changed files with 15 additions and 1 deletions

View File

@@ -133,7 +133,9 @@ func (h Hugo) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
// RunHugo is used to run the static website generator
func RunHugo(c *Config, force bool) {
os.RemoveAll(c.Root + "public")
if c.CleanPublic {
os.RemoveAll(c.Root + "public")
}
// Prevent running if watching is enabled
if b, pos := variables.StringInSlice("--watch", c.Args); b && !force {