-
Notifications
You must be signed in to change notification settings - Fork 642
Add some symlink support #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if entryType&fs.ModeIrregular != 0 && vfs.Realpath != nil { | ||
// Could be a Windows junction. Try Realpath. | ||
fullPath := path + "/" + entry.Name() | ||
if realpath := vfs.Realpath(fullPath); fullPath != realpath { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is not the fastest way to do this at all; but the code to do this correctly on Windows is pretty funky (see the intermediate state in #186, which I will bring back). Something I want to address in a follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference: 8998046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(realpath however, is very very reliable!)
This unbreaks
@types
auto loading when@types/*
are symlinks to dirs, which is what pnpm does.I think this probably completes symlink support outside of testing;
getAccessibleFileSystemEntries
appears to be the only thing that actually checked in the old codebase.I am not 100% happy with the callback-y nature of this, but I can't yet think of a better way to handle this code without repetition.