Using portable conditional syntax.

master
Jordan Harband 2014-05-02 23:28:42 -07:00
parent 80e349edb1
commit 87516039a8
1 changed files with 2 additions and 2 deletions

4
nvm.sh
View File

@ -37,8 +37,8 @@ fi
# Traverse up in directory tree to find containing folder
nvm_find_up() {
local path
path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=$PWD
while [ "$path" != "" ] && [ ! -f "$path/$1" ]; do
path=${path%/*}
done
echo "$path"