File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1666,9 +1666,11 @@ nvm_prune() {
16661666 esac
16671667 done
16681668
1669- nvm_echo " Pruning old installed versions..."
1670- if [ " ${NVM_DRY_RUN} " -eq 1 ]; then
1671- nvm_echo " Dry run mode: no versions will be removed."
1669+ if [ " ${NVM_DEBUG-} " = 1 ]; then
1670+ nvm_echo " Pruning old installed versions..."
1671+ if [ " ${NVM_DRY_RUN} " -eq 1 ]; then
1672+ nvm_echo " Dry run mode: no versions will be removed."
1673+ fi
16721674 fi
16731675
16741676 local HAS_SORT_V
@@ -1750,15 +1752,25 @@ END"
17501752 continue
17511753 fi
17521754 if [ " ${V} " = " ${CURRENT_VERSION} " ]; then
1753- nvm_echo " Keeping current version: ${V} "
1755+ if [ " ${NVM_DEBUG-} " = 1 ]; then
1756+ nvm_echo " Keeping current version: ${V} "
1757+ fi
17541758 continue
17551759 fi
17561760
17571761 # Re-resolve if the version is actually iojs
17581762 local UNINSTALL_V
17591763 UNINSTALL_V=" ${V} "
17601764 if ! nvm_is_version_installed " ${UNINSTALL_V} " > /dev/null 2>&1 ; then
1761- UNINSTALL_V=" $( nvm_add_iojs_prefix " ${V} " ) "
1765+ local IOJS_V
1766+ IOJS_V=" $( nvm_add_iojs_prefix " ${V} " ) "
1767+ if nvm_is_version_installed " ${IOJS_V} " > /dev/null 2>&1 ; then
1768+ UNINSTALL_V=" ${IOJS_V} "
1769+ fi
1770+ fi
1771+
1772+ if ! nvm_is_version_installed " ${UNINSTALL_V} " > /dev/null 2>&1 ; then
1773+ continue
17621774 fi
17631775
17641776 # Check for global npm modules explicitly
You can’t perform that action at this time.
0 commit comments