chokidar
chokidar copied to clipboard
Symlinks are always watched ignoring matching pattern and `followSymlinks` option
Describe the bug
Symlinks are always watched ignoring matching pattern and followSymlinks
option.
Versions (please complete the following information):
- Chokidar version 3.3.1
- Node version v12.12.0
- OS version: MacOS 10.15
To Reproduce:
Create a file named test.aaa
Create a file named test.bbb
Create a symlink to test.bbb
named test.ccc
const chokidar = require('chokidar')
const watcher = chokidar.watch('**/*.aaa')
const log = console.log.bind(console)
watcher
.on('add', path => log(`File ${path} has been added`))
.on('change', path => log(`File ${path} has been changed`))
.on('unlink', path => log(`File ${path} has been removed`))
Expected behavior
Only test.aaa
should be watched, but test.ccc
is watched as well.
Additional context Project: https://github.com/TheNeuronProject/ef.qt Related code: https://github.com/TheNeuronProject/ef.qt/blob/master/watcher.js#L113 When project includes symlinks, they are no matter how watched and caused issue on code compiling .