Add a global Reset func

So we can do some benchmarking.
This commit is contained in:
Bjørn Erik Pedersen 2016-08-16 12:50:26 +02:00
parent 2175ea5b06
commit 97c37732b4
1 changed files with 8 additions and 0 deletions

View File

@ -51,6 +51,14 @@ import (
// provide a cleaner external API, but until then, this is it.
var MainSite *hugolib.Site
// Reset resets Hugo ready for a new full build. This is mainly only useful
// for benchmark testing etc. via the CLI commands.
func Reset() error {
MainSite = nil
viper.Reset()
return nil
}
// userError is an error used to signal different error situations in command handling.
type commandError struct {
s string