commands: And now really fix the server watch logic

See #4275
This commit is contained in:
Bjørn Erik Pedersen
2018-01-15 10:02:17 +01:00
parent 4e524ffcff
commit d4f8f88e67
2 changed files with 38 additions and 12 deletions

View File

@@ -202,7 +202,7 @@ func server(cmd *cobra.Command, args []string) error {
return err
}
if err := c.build(serverWatch); err != nil {
if err := c.serverBuild(); err != nil {
return err
}
@@ -231,12 +231,14 @@ func server(cmd *cobra.Command, args []string) error {
rootWatchDirs := strings.Join(helpers.UniqueStrings(helpers.ExtractRootPaths(relWatchDirs)), ",")
jww.FEEDBACK.Printf("Watching for changes in %s%s{%s}\n", baseWatchDir, helpers.FilePathSeparator, rootWatchDirs)
err = c.newWatcher(watchDirs...)
watcher, err := c.newWatcher(watchDirs...)
if err != nil {
return err
}
defer watcher.Close()
}
return c.serve()