1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

Exit -1 on ERROR in non-global logger

Fixes #3239
This commit is contained in:
Bjørn Erik Pedersen
2017-03-27 10:55:29 +02:00
parent 2bea9d0ca1
commit 9262c5b32f

View File

@ -16,9 +16,10 @@ package main
import (
"runtime"
"os"
"github.com/spf13/hugo/commands"
jww "github.com/spf13/jwalterweatherman"
"os"
)
func main() {
@ -28,4 +29,10 @@ func main() {
if jww.LogCountForLevelsGreaterThanorEqualTo(jww.LevelError) > 0 {
os.Exit(-1)
}
if commands.Hugo != nil {
if commands.Hugo.Log.LogCountForLevelsGreaterThanorEqualTo(jww.LevelError) > 0 {
os.Exit(-1)
}
}
}