mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-02-06 18:02:50 +08:00
Merge cf9beb7f86 into 99352a64d2
This commit is contained in:
6
nvm.sh
6
nvm.sh
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user