Skip to content

Commit

Permalink
refactor codes
Browse files Browse the repository at this point in the history
  • Loading branch information
lyt122 committed Jul 16, 2024
1 parent b81b325 commit c879870
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/pkg/file/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ func (w *Watcher) Start(onChanged func()) {
for {
select {
case event := <-w.watcher.Events:
if event.Op.Has(fsnotify.Chmod) {
continue
if event.Op&fsnotify.Chmod != 0 {
event.Op &= ^fsnotify.Chmod // Remove the Chmod bit
if event.Op == 0 {
continue // Skip if it was only a Chmod event

Check warning on line 87 in plugins/pkg/file/fs.go

View check run for this annotation

Codecov / codecov/patch

plugins/pkg/file/fs.go#L85-L87

Added lines #L85 - L87 were not covered by tests
}
}
absPath, err := filepath.Abs(event.Name)
if err != nil {
Expand Down

0 comments on commit c879870

Please sign in to comment.