mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
fix(std/node): resolve files in symlinked directories (#8840)
This commit is contained in:
parent
39bbbbce70
commit
4c4791b589
4 changed files with 11 additions and 10 deletions
|
@ -764,16 +764,7 @@ function tryFile(requestPath: string, _isMain: boolean): string | false {
|
|||
}
|
||||
|
||||
function toRealPath(requestPath: string): string {
|
||||
// Deno does not have realpath implemented yet.
|
||||
let fullPath = requestPath;
|
||||
while (true) {
|
||||
try {
|
||||
fullPath = Deno.readLinkSync(fullPath);
|
||||
} catch {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return path.resolve(requestPath);
|
||||
return Deno.realPathSync(requestPath);
|
||||
}
|
||||
|
||||
// Given a path, check if the file exists with any of the set extensions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue