mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-17 11:03:44 +00:00
Compare commits
5 Commits
796a44c347
...
b7ec2d1ab7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b7ec2d1ab7 | ||
![]() |
ccf6d16017 | ||
![]() |
ba98270442 | ||
![]() |
cf9beb7f86 | ||
![]() |
9222739d18 |
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
@ -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 you‘re having trouble. If you have a feature request, or some other question, please feel free to clear out the form. Thanks! -->
|
||||
|
6
nvm.sh
6
nvm.sh
@ -455,6 +455,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}"
|
||||
|
@ -1,6 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
cleanup () {
|
||||
rm tmp3/tmp2
|
||||
rmdir tmp3
|
||||
rm tmp/node
|
||||
rmdir tmp
|
||||
rm tmp2/node
|
||||
@ -14,6 +16,8 @@ mkdir -p tmp
|
||||
touch tmp/node
|
||||
mkdir -p tmp2
|
||||
touch tmp2/node
|
||||
mkdir -p tmp3
|
||||
ln -s tmp2 tmp3/
|
||||
|
||||
[ "$(nvm_tree_contains_path 2>&1)" = "both the tree and the node path are required" ] || die 'incorrect error message with no args'
|
||||
[ "$(nvm_tree_contains_path > /dev/null 2>&1 ; echo $?)" = "2" ] || die 'incorrect error code with no args'
|
||||
@ -28,4 +32,6 @@ nvm_tree_contains_path tmp2 tmp2/node || die '"tmp2" should contain "tmp2/node"'
|
||||
|
||||
nvm_tree_contains_path tmp2 tmp/node && die '"tmp2" should not contain "tmp/node"'
|
||||
|
||||
nvm_tree_contains_path tmp2 tmp3 && die 'no idea'
|
||||
|
||||
cleanup
|
||||
|
Loading…
x
Reference in New Issue
Block a user