Skip to content

Commit 62fb0d0

Browse files
authored
Merge pull request nvm-sh#1605 from PeterDaveHello/fix-install.sh
[Fix] install.sh shouldn't use not existed variable
2 parents 6597e11 + a461a0f commit 62fb0d0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

install.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,12 @@ nvm_do_install() {
330330
BASH_OR_ZSH=false
331331

332332
if [ -z "${NVM_PROFILE-}" ] ; then
333-
echo "=> Profile not found. Tried ${NVM_PROFILE} (as defined in \$PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile."
333+
local TRIED_PROFILE
334+
if [ -n "${PROFILE}" ]; then
335+
TRIED_PROFILE="${NVM_PROFILE} (as defined in \$PROFILE), "
336+
fi
337+
echo "=> Profile not found. Tried ${TRIED_PROFILE-}~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile."
334338
echo "=> Create one of them and run this script again"
335-
echo "=> Create it (touch ${NVM_PROFILE}) and run this script again"
336339
echo " OR"
337340
echo "=> Append the following lines to the correct file yourself:"
338341
command printf "${SOURCE_STR}"

0 commit comments

Comments
 (0)