diff options
| author | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-06 22:30:55 +0200 |
|---|---|---|
| committer | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-06 22:30:55 +0200 |
| commit | e4c2f78abe427d9fdbfb46bb205f2210a03704fa (patch) | |
| tree | d7b355bd2aa5e76d828d9ffdbbcaf2b0ac088fac | |
| parent | 40b39e093ce6af33e82801c1edd7f64faa5ceee7 (diff) | |
| download | sourcewatch-e4c2f78abe427d9fdbfb46bb205f2210a03704fa.tar.gz sourcewatch-e4c2f78abe427d9fdbfb46bb205f2210a03704fa.zip | |
When mkdir -p creates multiple nested dirs at once, only the first
level got a watcher. Now syncCreate walks all subdirectories and
adds watchers for them. The event handler already filters ignored paths.
| -rw-r--r-- | watcher.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -113,6 +113,13 @@ func syncCreate(srcPath, destPath, relPath string, manifest *Manifest, stack *Gi if err := watcher.Add(srcPath); err != nil { logErrorf("watch %s: %v", relPath, err) } + filepath.Walk(srcPath, func(path string, info os.FileInfo, err error) error { + if err != nil || !info.IsDir() || path == srcPath { + return nil + } + watcher.Add(path) + return nil + }) if dryRun { logInfo("[dry-run] would create dir: %s", relPath) return |
