guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.92k stars 245 forks source link

Don't return incorrect files when there's a file whose name matches a dir #524

Closed ghiculescu closed 3 years ago

ghiculescu commented 3 years ago

Fixes a bug in https://github.com/guard/listen/pull/460

We have a file named cypress.json, and a dir named cypress, in a repo we are watching with listen.

Since upgrading to 3.3, listen will get confused and report that the file cypress/.json was removed. No such file exists.

I'm pretty sure this PR fixes that.

ghiculescu commented 3 years ago

Hey @ColinDKelley, thanks for the review!

Context is that listen is used by https://github.com/daveallie/entangler, we use it to 2-way sync files between local & remote workspaces. So the examples in my test are real examples from my codebase, where files that don't actually exist were incorrectly being reported as changed.

ghiculescu commented 3 years ago

I'm starting to think we've overcomplicated this: https://github.com/guard/listen/pull/526