Ensure after node v4.0 is released, stable will simply refer to the latest node.

This commit is contained in:
Jordan Harband
2015-08-22 09:45:49 -07:00
parent b7e2d7d24d
commit 8746d63041
2 changed files with 46 additions and 4 deletions

14
nvm.sh
View File

@@ -852,6 +852,7 @@ nvm_print_implicit_alias() {
local STABLE
local UNSTABLE
local MOD
local NORMALIZED_VERSION
ZHS_HAS_SHWORDSPLIT_UNSET=1
if nvm_has "setopt"; then
@@ -859,11 +860,16 @@ nvm_print_implicit_alias() {
setopt shwordsplit
fi
for MINOR in $LAST_TWO; do
MOD=$(expr "$(nvm_normalize_version "$MINOR")" \/ 1000000 \% 2)
if [ $MOD -eq 0 ]; then
NORMALIZED_VERSION="$(nvm_normalize_version "$MINOR")"
if [ "_0${NORMALIZED_VERSION#?}" != "_$NORMALIZED_VERSION" ]; then
STABLE="$MINOR"
elif [ $MOD -eq 1 ]; then
UNSTABLE="$MINOR"
else
MOD=$(expr "$NORMALIZED_VERSION" \/ 1000000 \% 2)
if [ $MOD -eq 0 ]; then
STABLE="$MINOR"
elif [ $MOD -eq 1 ]; then
UNSTABLE="$MINOR"
fi
fi
done
if [ $ZHS_HAS_SHWORDSPLIT_UNSET -eq 1 ] && nvm_has "unsetopt"; then