From: Bjørn Erik Pedersen Date: Fri, 11 Mar 2016 09:57:13 +0000 (+0100) Subject: Exit with error code on any error X-Git-Tag: v0.16~257 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7cd69aaae8ab6f9234fac530e2d6687f0c72849e;p=brevno-suite%2Fhugo Exit with error code on any error Fixes #740 --- diff --git a/main.go b/main.go index f3b14d97..25b0f6e8 100644 --- a/main.go +++ b/main.go @@ -17,9 +17,15 @@ import ( "runtime" "github.com/spf13/hugo/commands" + jww "github.com/spf13/jwalterweatherman" + "os" ) func main() { runtime.GOMAXPROCS(runtime.NumCPU()) commands.Execute() + + if jww.LogCountForLevelsGreaterThanorEqualTo(jww.LevelError) > 0 { + os.Exit(-1) + } }