mirror of
https://github.com/facundoolano/jorge.git
synced 2024-12-25 21:58:28 +01:00
watch includes and datafile dirs
This commit is contained in:
parent
0906b1ef45
commit
01d690b31d
2 changed files with 3 additions and 0 deletions
|
@ -10,6 +10,7 @@ import (
|
||||||
const SRC_DIR = "src"
|
const SRC_DIR = "src"
|
||||||
const TARGET_DIR = "target"
|
const TARGET_DIR = "target"
|
||||||
const LAYOUTS_DIR = "layouts"
|
const LAYOUTS_DIR = "layouts"
|
||||||
|
const INCLUDES_DIR = "includes"
|
||||||
const DATA_DIR = "data"
|
const DATA_DIR = "data"
|
||||||
|
|
||||||
func Init() error {
|
func Init() error {
|
||||||
|
|
|
@ -113,6 +113,8 @@ func setupWatcher() (*fsnotify.Watcher, error) {
|
||||||
// Add the layouts and all source directories to the given watcher
|
// Add the layouts and all source directories to the given watcher
|
||||||
func addAll(watcher *fsnotify.Watcher) error {
|
func addAll(watcher *fsnotify.Watcher) error {
|
||||||
err := watcher.Add(LAYOUTS_DIR)
|
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
|
// fsnotify watches all files within a dir, but non recursively
|
||||||
// this walks through the src dir and adds watches for each found directory
|
// 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 {
|
filepath.WalkDir(SRC_DIR, func(path string, entry fs.DirEntry, err error) error {
|
||||||
|
|
Loading…
Reference in a new issue