This commit is contained in:
Charlie Hileman
2025-04-23 19:25:25 -07:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

6
nvm.sh
View File

@@ -478,6 +478,12 @@ nvm_tree_contains_path() {
previous_pathdir="${node_path}"
local pathdir
pathdir=$(dirname "${previous_pathdir}")
# get real directory in case of symbolic links
if [ -d "${pathdir-}" ]; then
pathdir="$(nvm_cd -P "${pathdir}" && pwd)"
fi
while [ "${pathdir}" != '' ] && [ "${pathdir}" != '.' ] && [ "${pathdir}" != '/' ] &&
[ "${pathdir}" != "${tree}" ] && [ "${pathdir}" != "${previous_pathdir}" ]; do
previous_pathdir="${pathdir}"