diff options
author | Alan Pearce | 2024-06-19 13:50:37 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-19 14:10:44 +0200 |
commit | 45a2e290aa2bc59deb5971255accba517500cc25 (patch) | |
tree | 1d6fe7c96aab7e13faa2fdb5eea4416370a1423b /internal/server/server.go | |
parent | 1f9f24e2cef08f40fe2597b3644d08b28e31d370 (diff) | |
download | website-45a2e290aa2bc59deb5971255accba517500cc25.tar.lz website-45a2e290aa2bc59deb5971255accba517500cc25.tar.zst website-45a2e290aa2bc59deb5971255accba517500cc25.zip |
fix dev server/live reload
Diffstat (limited to 'internal/server/server.go')
-rw-r--r-- | internal/server/server.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/server/server.go b/internal/server/server.go index 1b0407d..a658235 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -100,7 +100,7 @@ func New(runtimeConfig *Config) (*Server, error) { if err != nil { return nil, errors.WithMessage(err, "could not create file watcher") } - for _, dir := range []string{"content", "static", "templates"} { + for _, dir := range []string{"content", "static", "templates", "internal/builder"} { err := fw.AddRecursive(dir) if err != nil { return nil, errors.WithMessagef( @@ -110,8 +110,11 @@ func New(runtimeConfig *Config) (*Server, error) { ) } } + err = fw.Add(".") + if err != nil { + return nil, errors.WithMessage(err, "could not add directory to file watcher") + } go fw.Start(func(filename string) { - log.Debug("file updated", "filename", filename) r, err := builder.BuildSite(builderConfig) if err != nil { log.Error("could not build site", "error", err) |