chokidar icon indicating copy to clipboard operation
chokidar copied to clipboard

Folder rename is not reported when using a pattern

Open Janpot opened this issue 11 months ago • 2 comments

Describe the bug

When a folder is renamed and the original and new folder is part of a path that is covered by a glob that chokidar is watching, no events are fired.

Versions:

  • Chokidar version: 3.5.3
  • Node version: 18.16.0
  • OS version: MacOs 13.5

To Reproduce:

  1. create a file ./hello/foo/file.txt
  2. run
    const path = require('path');
    const chokidar = require('chokidar');
    
    chokidar.watch(path.resolve(__dirname, './hello/*/file.txt')).on('all', (event, filePath) => {
      console.log(event, filePath);
    });
    
  3. run mv ./hello/foo ./hello/bar
  4. no events are being fired

Expected behavior

an unlink and add event is fired for the rename. (This does happen when using usePolling)

Janpot avatar Aug 04 '23 07:08 Janpot