From d9d3be33b4827b76b40a66d1ba1d6a9bb9a119ae Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Tue, 24 Mar 2020 08:04:47 -0700 Subject: [PATCH] Fix build on windows Summary: Fix for build on windows Reviewed By: mweststrate Differential Revision: D20601309 fbshipit-source-id: 9845964513d7904f58e3511b1c4daa8716f7b054 --- desktop/static/get-watch-folders.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/desktop/static/get-watch-folders.ts b/desktop/static/get-watch-folders.ts index f7eab2fbc..bf8f46ded 100644 --- a/desktop/static/get-watch-folders.ts +++ b/desktop/static/get-watch-folders.ts @@ -29,10 +29,11 @@ export default async (packageDir: string) => { } } } - if (packageDir === '/') { + const nextDir = path.dirname(packageDir); + if (!nextDir || nextDir === '/' || nextDir === packageDir) { break; } - packageDir = path.dirname(packageDir); + packageDir = nextDir; } return watchDirs; };