paulmillr / chokidar

Minimal and efficient cross-platform file watching library
https://paulmillr.com
MIT License
10.8k stars 574 forks source link

fix for #1011 #1289

Open glromeo opened 11 months ago

glromeo commented 11 months ago

When the call to ready() has been added to _addToNodeFs a bug has been introduced because it didn't consider that there was already a call to _emitReady() in add and the result is that ready get dispatched before all paths are scanned if one of them has errors. I am trying to fix that here and I also refactored the catch block to better express the fact that the condition is always true therefore there isn't a case in which ready() wouldn't have been called.