From 6304eb0893a9176ff41ad2bcb6924532a1b8a68a Mon Sep 17 00:00:00 2001 From: Tim Sawyer Date: Fri, 13 Apr 2018 10:41:53 -0700 Subject: [PATCH] Fix to handle symlinked files --- src/lib/application.ts | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/lib/application.ts b/src/lib/application.ts index ba72dff84..ef7aaac73 100644 --- a/src/lib/application.ts +++ b/src/lib/application.ts @@ -257,25 +257,28 @@ export class Application extends ChildableComponent { const realpath = Path.join(dirname, file); - if (FS.statSync(realpath).isDirectory()) { - add(realpath); - } else if (/\.tsx?$/.test(realpath)) { - if (isExcluded(realpath.replace(/\\/g, '/'))) { - return; + try { + if (FS.statSync(realpath).isDirectory()) { + add(realpath); + } else if (/\.tsx?$/.test(realpath)) { + if (isExcluded(realpath.replace(/\\/g, '/'))) { + return; + } + files.push(realpath); } - - files.push(realpath); - } + } catch (e) {} }); } inputFiles.forEach((file) => { file = Path.resolve(file); - if (FS.statSync(file).isDirectory()) { - add(file); - } else if (!isExcluded(file)) { - files.push(file); - } + try { + if (FS.statSync(file).isDirectory()) { + add(file); + } else if (!isExcluded(file)) { + files.push(file); + } + } catch (e) {} }); return files;