From f6f465280d99197bfa828b02533afd2bf0bfbcea Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 20 Nov 2017 14:26:09 -0800 Subject: [PATCH] Fix the error callback of the present directory watcher --- src/compiler/sys.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 841dba8a528..052a50ab0a9 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -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; }