Merge 6375e4ed79dc584a8174e5816d68a1c31b6d9b27 into 762f9ef9d17623b45095e8ca1a996c8928f3f424

This commit is contained in:
Jahir Raihan Joy 2024-07-07 00:32:42 +09:00 committed by GitHub
commit 95115aded1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

12
nvm.sh
View File

@ -417,6 +417,7 @@ else
fi
unset NVM_SCRIPT_SOURCE 2>/dev/null
nvm_tree_contains_path() {
local tree
tree="${1-}"
@ -432,14 +433,21 @@ nvm_tree_contains_path() {
previous_pathdir="${node_path}"
local pathdir
pathdir=$(dirname "${previous_pathdir}")
# Convert tree path to canonical form for case-insensitive comparison
local tree_canonical
tree_canonical=$(cd "${tree}" && pwd -P)
while [ "${pathdir}" != '' ] && [ "${pathdir}" != '.' ] && [ "${pathdir}" != '/' ] &&
[ "${pathdir}" != "${tree}" ] && [ "${pathdir}" != "${previous_pathdir}" ]; do
[ "${pathdir}" != "${tree_canonical}" ] && [ "${pathdir}" != "${previous_pathdir}" ]; do
previous_pathdir="${pathdir}"
pathdir=$(dirname "${previous_pathdir}")
done
[ "${pathdir}" = "${tree}" ]
[ "${pathdir}" = "${tree_canonical}" ]
}
nvm_find_project_dir() {
local path_
path_="${PWD}"