-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix: resolve symbolic links completely when hunting for subcommands #935
fix: resolve symbolic links completely when hunting for subcommands #935
Conversation
Depending on your npm / yarn set up a global install may have to resolve through several symlinks before it correctly arrives the the baseDir that actually contains the other subcommands. The changes the resolution logic to resolve symlinks until their are no more to resolve by using realpath which will resolve links all the way to the final destination.
52cfb52
to
994d24d
Compare
Might take me a few days, but I am looking forward to reviewing this. Hopefully fixes #866 (and without adding a dependency as in #869). @MarshallOfSound could you please suggest some reproduction steps that match how a user might end up with the broken symlink? It sounded like you had something in mind:
I did find mention of yarn install in #866 (comment) and will be trying that too. |
I'm not the OP, but I have a package that you can replicate the issue with via:
and then run:
in some temporary directory. |
@shadowspawn Anyone using subcommands and the latest version of Yarn installs the binary to You can repro this quite easily with |
@MarshallOfSound I did not know about |
(My review progress: examined code and related issues and tested on Mac, looking good, Windows still to go.) |
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.
Thanks, tidy.
@shadowspawn What needs to happen to get this merged and released? |
@MarshallOfSound |
Thank you! |
Depending on your npm / yarn set up a global install may have to resolve through several symlinks before it correctly arrives the the baseDir that actually contains the other subcommands. The links go between directories so if we stop after the first link
baseDir
is looking in the wrong placeThe changes the resolution logic to resolve symlinks until their are no more to resolve by using
realpath
which will resolve links all the way to the final destination.