Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watching based on glob triggers on irrelevant files #1290

Open
jeremyben-meir opened this issue Oct 10, 2023 · 0 comments
Open

Watching based on glob triggers on irrelevant files #1290

jeremyben-meir opened this issue Oct 10, 2023 · 0 comments

Comments

@jeremyben-meir
Copy link

Describe the bug

I want to scan my entire filesystem and check for changes only in .txt files. However, I am seeing changes in a bunch of non-txt files.

Versions (please complete the following information):

  • Chokidar version 3.5.3
  • Node version: 20.8.0
  • OS version: MacOS 14.0

To Reproduce:

test.ts

var chokidar = require('chokidar');
const watcher = chokidar.watch('/**/*.txt', {
  persistent: true,
  ignoreInitial: true,
});
watcher.on('change', function (path: string) {
  console.log('File', path, 'has been changed');
});

Output:

File /var/db/diagnostics/Persist/0000000000002a33.tracev3 has been changed
File /var/folders/__/adf2kf994fqg8oinfhxle9fje0000fv/C/mds/mdsObject.db has been changed
File /var/folders/__/adf2kf994fqg8oinfhxle9fje0000fv/C/mds/mdsDirectory.db has been changed
...

Expected behavior
I expect to see only changes in .txt files. This output would be reasonable:

File /path0/to/test0.txt has been changed
File /path0/to/test1.txt has been changed
File /path1/to/test0.txt has been changed
File /path1/to/test0.txt has been changed
...

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant