Using portable conditional syntax.
parent
80e349edb1
commit
87516039a8
4
nvm.sh
4
nvm.sh
|
@ -37,8 +37,8 @@ fi
|
||||||
# Traverse up in directory tree to find containing folder
|
# Traverse up in directory tree to find containing folder
|
||||||
nvm_find_up() {
|
nvm_find_up() {
|
||||||
local path
|
local path
|
||||||
path=$(pwd)
|
path=$PWD
|
||||||
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
|
while [ "$path" != "" ] && [ ! -f "$path/$1" ]; do
|
||||||
path=${path%/*}
|
path=${path%/*}
|
||||||
done
|
done
|
||||||
echo "$path"
|
echo "$path"
|
||||||
|
|
Loading…
Reference in New Issue