Skip to content

Commit 22f15d0

Browse files
Guille Esguerraesguerrag
authored andcommitted
updating the dry run output
1 parent 7645176 commit 22f15d0

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

‎nvm.sh‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)