From c7cac323d6509a14ae5a1bb9505e08405ec14cb7 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Sat, 26 Aug 2017 22:45:07 +0200 Subject: [PATCH] look in other pathes when the current fails to return a prefix --- nvm.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index d28ce9e..e495ac1 100644 --- a/nvm.sh +++ b/nvm.sh @@ -2112,7 +2112,9 @@ nvm_die_on_prefix() { for npmrc in "${npmrcs[@]}"; do if [ -f "${npmrc}/.npmrc" ]; then NVM_NPM_PREFIX=$(grep ^prefix= ${npmrc}/.npmrc | sed s/prefix=\\\(.*\\\)$/\\1/) - break + if [[ -n $NVM_NPM_PREFIX ]]; then + break + fi fi done