-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Normalize paths in nvm_tree_contains_path
before comparing
#2045
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
This will not work on macos because macos doesn't come with |
The lack of |
What about a function like this
|
Is readlink in posix? |
the readlink function yes, the readlink command no |
As @ljharb suggested this would be POSIX |
What about replacing At the time |
@mvastola not every node version has |
It's possible that `tree` and `node_path` both refer to the same directory, but are lexically different. This converts both paths into a canonical form so that any lexical-only differences are removed. This solves a problem where setting `NVM_DIR` to /home/user//.nvm instead of /home/user/.nvm results in the infamous: nvm is not compatible with the npm config "prefix" option This adds a test that the above case no longer results in an error. An existing test stopped failing as expected as a result, as the test set the npm prefix to a local-directory-relative path, which resolved to a directory inside the `NVM_DIR` when running the tests from within the `NVM_DIR`. This test is updated to use an absolute path.
f6757b1
to
e77cead
Compare
The problem this PR solves no longer occurs (just tested with v0.38). Closing. |
It's possible that
tree
andnode_path
both refer to the samedirectory, but are lexically different. This converts both paths
into a canonical form so that any lexical-only differences are
removed.
This solves a problem where setting
NVM_DIR
to /home/user//.nvminstead of /home/user/.nvm results in the infamous:
nvm is not compatible with the npm config "prefix" option
This adds a test that the above case no longer results in an error. An
existing test stopped failing as expected as a result, as the test set
the npm prefix to a local-directory-relative path, which resolved to
a directory inside the
NVM_DIR
when running the tests from within theNVM_DIR
. This test is updated to use an absolute path.