Fix the error callback of the present directory watcher

This commit is contained in:
Sheetal Nandi 2017-11-20 14:26:09 -08:00
parent e248d08e4c
commit f6f465280d

View File

@ -291,12 +291,11 @@ namespace ts {
callback
);
dirWatcher.on("error", () => {
if (!directoryExists(directoryName)) {
// Deleting directory
watcher = watchMissingDirectory();
// Call the callback for current directory
callback("rename", "");
}
// Watch the missing directory
watcher.close();
watcher = watchMissingDirectory();
// Call the callback for current directory
callback("rename", "");
});
return dirWatcher;
}