Skip to content

Commit

Permalink
[Fix] nvm_die_on_prefix: allow $NVM_DIR to be a symlink
Browse files Browse the repository at this point in the history
`cd -P` is in POSIX.
  • Loading branch information
GolanTrevize10 authored and ljharb committed Jan 10, 2020
1 parent 8093dbe commit eff4f5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2187,7 +2187,7 @@ nvm_die_on_prefix() {
if [ -n "${NVM_NPM_CONFIG_PREFIX_ENV-}" ]; then
local NVM_CONFIG_VALUE
eval "NVM_CONFIG_VALUE=\"\$${NVM_NPM_CONFIG_PREFIX_ENV}\""
if [ -n "${NVM_CONFIG_VALUE-}" ] && ! nvm_tree_contains_path "${NVM_DIR}" "${NVM_CONFIG_VALUE}"; then
if [ -n "${NVM_CONFIG_VALUE-}" ] && ! nvm_tree_contains_path "$(cd -P "${NVM_DIR}" && pwd)" "${NVM_CONFIG_VALUE}"; then
nvm deactivate >/dev/null 2>&1
nvm_err "nvm is not compatible with the \"${NVM_NPM_CONFIG_PREFIX_ENV}\" environment variable: currently set to \"${NVM_CONFIG_VALUE}\""
nvm_err "Run \`unset ${NVM_NPM_CONFIG_PREFIX_ENV}\` to unset it."
Expand Down

0 comments on commit eff4f5f

Please sign in to comment.