Compare commits

...

4 Commits

Author SHA1 Message Date
Jahir Raihan Joy
844551c6b2
Merge 6375e4ed79dc584a8174e5816d68a1c31b6d9b27 into ccf6d160172ab57f9777e88af5fa51240108285a 2024-11-04 15:08:31 +00:00
Jordan Harband
ccf6d16017
[meta] disable blank issues 2024-11-04 15:07:16 +00:00
Jordan Harband
ba98270442
[meta] update issue template 2024-11-04 15:01:26 +00:00
Jahir Raihan Joy
6375e4ed79 converted tree path to canonical form for case-insensitive comp 2024-05-09 16:24:33 +06:00
3 changed files with 19 additions and 2 deletions

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1 @@
blank_issues_enabled: false

View File

@ -1,3 +1,11 @@
---
name: File an issue…
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
<!-- Thank you for being interested in nvm! Please help us by filling out the following form if youre having trouble. If you have a feature request, or some other question, please feel free to clear out the form. Thanks! --> <!-- Thank you for being interested in nvm! Please help us by filling out the following form if youre having trouble. If you have a feature request, or some other question, please feel free to clear out the form. Thanks! -->

12
nvm.sh
View File

@ -440,6 +440,7 @@ else
fi fi
unset NVM_SCRIPT_SOURCE 2>/dev/null unset NVM_SCRIPT_SOURCE 2>/dev/null
nvm_tree_contains_path() { nvm_tree_contains_path() {
local tree local tree
tree="${1-}" tree="${1-}"
@ -455,14 +456,21 @@ nvm_tree_contains_path() {
previous_pathdir="${node_path}" previous_pathdir="${node_path}"
local pathdir local pathdir
pathdir=$(dirname "${previous_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}" != '/' ] && while [ "${pathdir}" != '' ] && [ "${pathdir}" != '.' ] && [ "${pathdir}" != '/' ] &&
[ "${pathdir}" != "${tree}" ] && [ "${pathdir}" != "${previous_pathdir}" ]; do [ "${pathdir}" != "${tree_canonical}" ] && [ "${pathdir}" != "${previous_pathdir}" ]; do
previous_pathdir="${pathdir}" previous_pathdir="${pathdir}"
pathdir=$(dirname "${previous_pathdir}") pathdir=$(dirname "${previous_pathdir}")
done done
[ "${pathdir}" = "${tree}" ]
[ "${pathdir}" = "${tree_canonical}" ]
} }
nvm_find_project_dir() { nvm_find_project_dir() {
local path_ local path_
path_="${PWD}" path_="${PWD}"