add viper.reset

This commit is contained in:
Henrique Dias 2016-02-16 21:18:33 +00:00
parent 2414f2edec
commit d6472c68f1

View File

@ -14,6 +14,7 @@ import (
"github.com/hacdias/caddy-hugo/assets"
"github.com/hacdias/caddy-hugo/config"
"github.com/spf13/hugo/commands"
"github.com/spf13/viper"
)
// CanBeEdited checks if the extension of a file is supported by the editor
@ -168,6 +169,7 @@ func Run(c *config.Config) {
os.RemoveAll(c.Path + "public")
commands.MainSite = nil
viper.Reset()
c.Args = append([]string{"--source", c.Path}, c.Args...)
commands.HugoCmd.ParseFlags(c.Args)
if err := commands.HugoCmd.RunE(nil, nil); err != nil {