shama/gaze — pull request #153 by joshjensen (2014-10-08 01:05:55+00:00)
Title: Fix for ENOENT, no such file or directory error - Take 2

Hey Kyle, thanks for the great module. I ran into one small issue. There is a 3rd party build script that when run against my project creates then immediately deletes a folder. The issue happens when I am watching the same folder with Gaze. That process seems to cause an error to be thrown.

fs.js:18060: Uncaught Error: ENOENT, no such file or directory

Then this status is shown immediately following the error:
{filename} was deleted

After digging around it seemed to be this was the line var dirstat = fs.statSync(dir); that was causing the issue. I added a check to make sure the folder exists before statSync is run.

Thanks!

Please note: The last PR was failing. I ran the tests on this and it seems to be passing now.