From 91a29c0da2bc1986fdab5f4a77a0b20302d4896c Mon Sep 17 00:00:00 2001 From: mail6543210 Date: Mon, 20 Nov 2017 22:31:12 +0800 Subject: [PATCH] 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 --- nvm.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nvm.sh b/nvm.sh index 472b20d..dd4f884 100644 --- a/nvm.sh +++ b/nvm.sh @@ -273,12 +273,12 @@ nvm_tree_contains_path() { # Traverse up in directory tree to find containing folder nvm_find_up() { - local path - path="${PWD}" - while [ "${path}" != "" ] && [ ! -f "${path}/${1-}" ]; do - path=${path%/*} + local path_ + path_="${PWD}" + while [ "${path_}" != "" ] && [ ! -f "${path_}/${1-}" ]; do + path_=${path_%/*} done - nvm_echo "${path}" + nvm_echo "${path_}" }