From a461a0fffcd9163726f4d652ca974d97a1097356 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Thu, 7 Sep 2017 17:51:24 +0800 Subject: [PATCH] [Fix] install.sh shouldn't use not existed $NVM_PROFILE --- install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index f04fc6c..3fd2089 100755 --- a/install.sh +++ b/install.sh @@ -330,9 +330,12 @@ nvm_do_install() { BASH_OR_ZSH=false if [ -z "${NVM_PROFILE-}" ] ; then - echo "=> Profile not found. Tried ${NVM_PROFILE} (as defined in \$PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile." + local TRIED_PROFILE + if [ -n "${PROFILE}" ]; then + TRIED_PROFILE="${NVM_PROFILE} (as defined in \$PROFILE), " + fi + echo "=> Profile not found. Tried ${TRIED_PROFILE-}~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile." echo "=> Create one of them and run this script again" - echo "=> Create it (touch ${NVM_PROFILE}) and run this script again" echo " OR" echo "=> Append the following lines to the correct file yourself:" command printf "${SOURCE_STR}"