Skip to content

Commit

Permalink
Update nvm.sh with suggestions from ljharb
Browse files Browse the repository at this point in the history
Co-Authored-By: Jordan Harband <[email protected]>
  • Loading branch information
aiqui and ljharb authored Jan 12, 2020
1 parent 1825923 commit 15f1d86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ nvm_tree_contains_path() {
pathdir=$(dirname "${node_path}")

# get real directory in case of symbolic links
[ -d "${pathdir}" ] && pathdir="$( cd -P "${pathdir}" && pwd )"
if [ -d "${pathdir-}" ]; then
pathdir="$(nvm_cd -P "${pathdir}" && pwd)"
fi

while [ "${pathdir}" != "" ] && [ "${pathdir}" != "." ] && [ "${pathdir}" != "/" ] && [ "${pathdir}" != "${tree}" ]; do
pathdir=$(dirname "${pathdir}")
Expand Down

0 comments on commit 15f1d86

Please sign in to comment.