commands: Fix doLiveReload logic

Fixes #5754
This commit is contained in:
Bjørn Erik Pedersen 2019-03-14 21:39:00 +01:00
parent 79d517d86c
commit 4a2a8afff2
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -304,7 +304,7 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error {
}
// Set some commonly used flags
c.doLiveReload = !c.h.buildWatch && !c.Cfg.GetBool("disableLiveReload")
c.doLiveReload = running && !c.Cfg.GetBool("disableLiveReload")
c.fastRenderMode = c.doLiveReload && !c.Cfg.GetBool("disableFastRender")
c.showErrorInBrowser = c.doLiveReload && !c.Cfg.GetBool("disableBrowserError")
@ -351,6 +351,7 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error {
// to make that decision.
irrelevantRe: regexp.MustCompile(`\.map$`),
}
changeDetector.PrepareNew()
fs.Destination = hugofs.NewHashingFs(fs.Destination, changeDetector)
c.changeDetector = changeDetector