Skip to content

Commit 15f1d86

Browse files
aiquiljharb
andauthored
Update nvm.sh with suggestions from ljharb
Co-Authored-By: Jordan Harband <[email protected]>
1 parent 1825923 commit 15f1d86

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nvm.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ nvm_tree_contains_path() {
313313
pathdir=$(dirname "${node_path}")
314314

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

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

0 commit comments

Comments
 (0)