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>2017-03-27 11:55:29 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-27 11:55:29 +0300
commit9262c5b32f99d677b6878984e35dbd6a5b31fbd8 (patch)
tree8ee232fc3fb5be2c648c42526f0760b32066a5c8 /main.go
parent2bea9d0ca19fb442803abf57171e89b9d824b154 (diff)
Exit -1 on ERROR in non-global logger
Fixes #3239
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.go b/main.go
index 25b0f6e86..189cac43e 100644
--- a/main.go
+++ b/main.go
@@ -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)
+ }
+ }
}