-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
adjust for symbolic links #2143
base: master
Are you sure you want to change the base?
Conversation
Co-Authored-By: Charlie Hileman <[email protected]> Co-Authored-By: Jordan Harband <[email protected]>
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.
Turns out cd -P
is indeed in POSIX! https://pubs.opengroup.org/onlinepubs/9699919799/utilities/cd.html \( ゚◡゚)/
This will need tests.
The code looks good, but this is breaking existing unit tests for |
@aiqui any interest in completing this PR? |
I've started some more work on this in https://github.com/olivermg/nvm . However, the current state does not yet fix the complaint of nvm whenever |
Hey @olivermg, want to check on latest master branch, my PR from the other day adjusted the prefix check to handle symlinks, so it never hits the nvm_tree_contains_path code anymore. |
c6cfc3a
to
c20db2a
Compare
Currently the nvm.sh script does not handle directories that are symbolic links. This is a common problem on servers that use symbolic links to persistent drives. For example, an admin might want to install nvm into /opt/local/node, but the real location (without the symlinks) is /files2/opt-local/node/nvm. This results in:
Assuming the admin knows this issue and uses the real directory, there is no problem:
The small change I am providing will get the real directory to avoid the problem with symbolic links.
I don't know if cd -P is available on all Linux systems, but I have tested in MacOS, RedHat, AWS AMI and Debian.