mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Fix watcher detecting changes as static when no theme
There have been some changes to the ´helpers.GetThemesDirPath()´ so it now returns an empty string when no theme. This is correct, but it broke the watch service (at lest on OSX), as `strings.HasPrefix("", "somestring") evaluates to true somehow, and content changes are incorrectly branded as static. There are other issues in there, but that will come later ... See #1236
This commit is contained in:
parent
a509a23255
commit
033a13e10e
1 changed files with 1 additions and 1 deletions
|
@ -444,7 +444,7 @@ func NewWatcher(port int) error {
|
|||
continue
|
||||
}
|
||||
|
||||
isstatic := strings.HasPrefix(ev.Name, helpers.GetStaticDirPath()) || strings.HasPrefix(ev.Name, helpers.GetThemesDirPath())
|
||||
isstatic := strings.HasPrefix(ev.Name, helpers.GetStaticDirPath()) || (len(helpers.GetThemesDirPath()) > 0 && strings.HasPrefix(ev.Name, helpers.GetThemesDirPath()))
|
||||
staticChanged = staticChanged || isstatic
|
||||
dynamicChanged = dynamicChanged || !isstatic
|
||||
|
||||
|
|
Loading…
Reference in a new issue