return filepath.SkipDir instead of nil for excluded dir entries
This commit is contained in:
+4
-2
@@ -1,10 +1,12 @@
|
||||
## v0.39.2 (WIP)
|
||||
## v0.39.2
|
||||
|
||||
- Fixed records list UI sorting ([#7724](https://github.com/pocketbase/pocketbase/issues/7724)).
|
||||
|
||||
- Don't clear the date input on invalid value while still typing ([#7726](https://github.com/pocketbase/pocketbase/issues/7726)).
|
||||
|
||||
- Updated `modernc.org/sqlite` to v1.52.0 ([SQLite 3.53.2](https://sqlite.org/releaselog/3_53_2.html)).
|
||||
- Return `filepath.SkipDir` in the `pb_hooks` dirs watcher to avoid unnecessery iterating over `node_modules` and `.*` prefixed hidden dirs (e.g. `.DS_store`, `.git`, etc.).
|
||||
|
||||
- Updated `modernc.org/sqlite` to v1.52.0 ([SQLite 3.53.2](https://sqlite.org/src/timeline?from=version-3.53.0&to=version-3.53.2&to2=branch-3.53&y=ci)).
|
||||
|
||||
|
||||
## v0.39.1
|
||||
|
||||
@@ -443,11 +443,16 @@ func (p *plugin) watchHooks() error {
|
||||
//
|
||||
// @todo replace once recursive watcher is added (https://github.com/fsnotify/fsnotify/issues/18)
|
||||
dirsErr := filepath.WalkDir(watchDir, func(path string, entry fs.DirEntry, err error) error {
|
||||
// skip access failures, hidden directories, node_modules, etc.
|
||||
if err != nil || !entry.IsDir() || entry.Name() == "node_modules" || strings.HasPrefix(entry.Name(), ".") {
|
||||
// ignore access failures and non-dir entries
|
||||
if err != nil || !entry.IsDir() {
|
||||
return nil
|
||||
}
|
||||
|
||||
// skip traversing hidden directories and node_modules
|
||||
if strings.HasPrefix(entry.Name(), ".") || entry.Name() == "node_modules" {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
|
||||
return watcher.Add(path)
|
||||
})
|
||||
if dirsErr != nil {
|
||||
|
||||
Reference in New Issue
Block a user