mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Add a global Reset func
So we can do some benchmarking.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user