Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-08-16 13:50:26 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-08-16 13:50:26 +0300
commit97c37732b41dee3fdc9444a4ec4094b02ae5815d (patch)
treef31a9508269f63b0ae4e58748e8e4d09dbfc7dab /commands
parent2175ea5b0662d737fbd07c7549acfcdbbebf7dee (diff)
Add a global Reset func
So we can do some benchmarking.
Diffstat (limited to 'commands')
-rw-r--r--commands/hugo.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/commands/hugo.go b/commands/hugo.go
index d72c6acee..7afd78a9d 100644
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -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