From 01d690b31d444212d9d17467068a5d93be01f0b0 Mon Sep 17 00:00:00 2001 From: facundoolano Date: Thu, 15 Feb 2024 17:01:14 -0300 Subject: [PATCH] watch includes and datafile dirs --- commands/commands.go | 1 + commands/serve.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/commands/commands.go b/commands/commands.go index aba9802..161a872 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -10,6 +10,7 @@ import ( const SRC_DIR = "src" const TARGET_DIR = "target" const LAYOUTS_DIR = "layouts" +const INCLUDES_DIR = "includes" const DATA_DIR = "data" func Init() error { diff --git a/commands/serve.go b/commands/serve.go index e36993f..fb43edf 100644 --- a/commands/serve.go +++ b/commands/serve.go @@ -113,6 +113,8 @@ func setupWatcher() (*fsnotify.Watcher, error) { // Add the layouts and all source directories to the given watcher func addAll(watcher *fsnotify.Watcher) error { err := watcher.Add(LAYOUTS_DIR) + err = watcher.Add(DATA_DIR) + err = watcher.Add(INCLUDES_DIR) // fsnotify watches all files within a dir, but non recursively // this walks through the src dir and adds watches for each found directory filepath.WalkDir(SRC_DIR, func(path string, entry fs.DirEntry, err error) error {