Print parse errors from Viper

This commit is contained in:
Bjørn Erik Pedersen 2015-11-11 22:47:09 +01:00
parent 469d268cc8
commit 3bbd02a1ca

View file

@ -185,7 +185,11 @@ func InitializeConfig() {
}
err := viper.ReadInConfig()
if err != nil {
jww.ERROR.Println("Unable to locate Config file. Perhaps you need to create a new site. Run `hugo help new` for details")
if _, ok := err.(viper.ConfigParseError); ok {
jww.ERROR.Println(err)
} else {
jww.ERROR.Println("Unable to locate Config file. Perhaps you need to create a new site. Run `hugo help new` for details", err)
}
}
viper.RegisterAlias("indexes", "taxonomies")