Fix for $path used by zsh

"The lower-case version of PATH is an array parameter
bound to the scalar upper-case parameter."
-- http://www.zsh.org/mla/users/2015/msg00178.html
mail6543210 2017-11-20 22:31:12 +08:00
parent 4b48556e92
commit 91a29c0da2
1 changed files with 5 additions and 5 deletions

10
nvm.sh
View File

@ -273,12 +273,12 @@ nvm_tree_contains_path() {
# 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}" != "" ] && [ ! -f "${path}/${1-}" ]; do while [ "${path_}" != "" ] && [ ! -f "${path_}/${1-}" ]; do
path=${path%/*} path_=${path_%/*}
done done
nvm_echo "${path}" nvm_echo "${path_}"
} }