From 97c37732b41dee3fdc9444a4ec4094b02ae5815d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 16 Aug 2016 12:50:26 +0200 Subject: [PATCH] Add a global Reset func So we can do some benchmarking. --- commands/hugo.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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