Skip to content

Commit aeab029

Browse files
Gerrit0timsawyer
andcommitted
fix: Catch error in expandInputFiles
Closes #751 Co-Authored-By: Tim Sawyer <[email protected]>
1 parent 4d8f2c7 commit aeab029

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/lib/application.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,15 @@ export class Application extends ChildableComponent<
305305

306306
const supportedFileRegex = this.options.getCompilerOptions().allowJs ? /\.[tj]sx?$/ : /\.tsx?$/;
307307
function add(file: string, entryPoint: boolean) {
308-
const fileIsDir = FS.statSync(file).isDirectory();
309-
if (fileIsDir && file.slice(-1) !== '/') {
308+
let stats: FS.Stats;
309+
try {
310+
stats = FS.statSync(file);
311+
} catch {
312+
// No permission or a symbolic link, do not resolve.
313+
return;
314+
}
315+
const fileIsDir = stats.isDirectory();
316+
if (fileIsDir && !file.endsWith('/')) {
310317
file = `${file}/`;
311318
}
312319

0 commit comments

Comments
 (0)