Implement auto reload of config

This commit is contained in:
Kovid Goyal
2026-04-16 14:39:51 +05:30
parent efbfbb49f9
commit e9f3844f64
8 changed files with 29 additions and 4 deletions

View File

@@ -27,7 +27,9 @@ func watch_dirs(ctx context.Context, paths []string, debounce time.Duration, eve
fswatcher.WithCooldown(debounce),
}
for _, path := range paths {
opts = append(opts, fswatcher.WithPath(path))
if unix.Access(path, unix.R_OK|unix.X_OK) == nil {
opts = append(opts, fswatcher.WithPath(path))
}
}
w, err := fswatcher.New(opts...)
if err != nil {