mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Add a global Reset func
So we can do some benchmarking.
This commit is contained in:
parent
2175ea5b06
commit
97c37732b4
1 changed files with 8 additions and 0 deletions
|
@ -51,6 +51,14 @@ import (
|
||||||
// provide a cleaner external API, but until then, this is it.
|
// provide a cleaner external API, but until then, this is it.
|
||||||
var MainSite *hugolib.Site
|
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.
|
// userError is an error used to signal different error situations in command handling.
|
||||||
type commandError struct {
|
type commandError struct {
|
||||||
s string
|
s string
|
||||||
|
|
Loading…
Reference in a new issue