Skip to content

Commit

Permalink
fix: Catch error in expandInputFiles
Browse files Browse the repository at this point in the history
Closes #751

Co-Authored-By: Tim Sawyer <timsawyer@users.noreply.github.com>
  • Loading branch information
Gerrit0 and timsawyer committed Jan 12, 2020
1 parent 4d8f2c7 commit aeab029
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/lib/application.ts
Expand Up @@ -305,8 +305,15 @@ export class Application extends ChildableComponent<

const supportedFileRegex = this.options.getCompilerOptions().allowJs ? /\.[tj]sx?$/ : /\.tsx?$/;
function add(file: string, entryPoint: boolean) {
const fileIsDir = FS.statSync(file).isDirectory();
if (fileIsDir && file.slice(-1) !== '/') {
let stats: FS.Stats;
try {
stats = FS.statSync(file);
} catch {
// No permission or a symbolic link, do not resolve.
return;
}
const fileIsDir = stats.isDirectory();
if (fileIsDir && !file.endsWith('/')) {
file = `${file}/`;
}

Expand Down

0 comments on commit aeab029

Please sign in to comment.