look in other pathes when the current fails to return a prefix

This commit is contained in:
Tobias Gurtzick 2017-08-26 22:45:07 +02:00
parent 2e6e512fd5
commit c7cac323d6
No known key found for this signature in database
GPG Key ID: 6C56E4E3D2EAC901

2
nvm.sh
View File

@ -2112,8 +2112,10 @@ nvm_die_on_prefix() {
for npmrc in "${npmrcs[@]}"; do for npmrc in "${npmrcs[@]}"; do
if [ -f "${npmrc}/.npmrc" ]; then if [ -f "${npmrc}/.npmrc" ]; then
NVM_NPM_PREFIX=$(grep ^prefix= ${npmrc}/.npmrc | sed s/prefix=\\\(.*\\\)$/\\1/) NVM_NPM_PREFIX=$(grep ^prefix= ${npmrc}/.npmrc | sed s/prefix=\\\(.*\\\)$/\\1/)
if [[ -n $NVM_NPM_PREFIX ]]; then
break break
fi fi
fi
done done
if [[ -n $NVM_NPM_PREFIX ]]; then if [[ -n $NVM_NPM_PREFIX ]]; then