mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Do not exit server watch on error
Before this commit any error (typically a YAML typing error in front matter) would exit server on rebuild when running `hugo server -w`. This is very annoying as it doesn't give you any chance to fix the typo other than doing a manual restart. This commit fixes that by just logging these errors when these rebuilds happen when changes are detected. Fixes #781
This commit is contained in:
parent
190964c57b
commit
2b46f3e51e
1 changed files with 1 additions and 1 deletions
|
@ -397,7 +397,7 @@ func NewWatcher(port int) error {
|
||||||
fmt.Print("\nChange detected, rebuilding site\n")
|
fmt.Print("\nChange detected, rebuilding site\n")
|
||||||
const layout = "2006-01-02 15:04 -0700"
|
const layout = "2006-01-02 15:04 -0700"
|
||||||
fmt.Println(time.Now().Format(layout))
|
fmt.Println(time.Now().Format(layout))
|
||||||
utils.StopOnErr(buildSite(true))
|
utils.CheckErr(buildSite(true))
|
||||||
|
|
||||||
if !BuildWatch && !viper.GetBool("DisableLiveReload") {
|
if !BuildWatch && !viper.GetBool("DisableLiveReload") {
|
||||||
// Will block forever trying to write to a channel that nobody is reading if livereload isn't initalized
|
// Will block forever trying to write to a channel that nobody is reading if livereload isn't initalized
|
||||||
|
|
Loading…
Reference in a new issue