Skip to content

Commit

Permalink
Pass absolute path to directoryExists
Browse files Browse the repository at this point in the history
As pointed out by @gretzkiy, the `directoryExists` call added to
`matchFiles` in #44710 should have been passing the absolute path (since
the current directory might not match `currentDirectory`).
  • Loading branch information
amcasey committed Sep 27, 2021
1 parent 26aef89 commit ba70c53
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6634,8 +6634,9 @@ namespace ts {
const visited = new Map<string, true>();
const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames);
for (const basePath of patterns.basePaths) {
if (directoryExists(basePath)) {
visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
const absoluteBasePath = combinePaths(currentDirectory, basePath);
if (directoryExists(absoluteBasePath)) {
visitDirectory(basePath, absoluteBasePath, depth);
}
}

Expand Down

0 comments on commit ba70c53

Please sign in to comment.