Make nvm alias list implicit "stable" and "unstable" aliases when they're not already aliases.

This commit is contained in:
Jordan Harband
2014-09-29 00:09:17 -07:00
parent f9565ff675
commit 5dc7af6285
4 changed files with 66 additions and 0 deletions

10
nvm.sh
View File

@@ -876,6 +876,16 @@ nvm() {
fi
fi
done
for ALIAS in "stable" "unstable"; do
if [ ! -f "$NVM_DIR/alias/$ALIAS" ]; then
if [ $# -lt 2 ] || [ "~$ALIAS" = "~$2" ]; then
DEST="$(nvm_print_implicit_alias local "$ALIAS")"
VERSION="$(nvm_version "$DEST")"
echo "$ALIAS -> $DEST (-> $VERSION) (default)"
fi
fi
done
return
fi
if [ -z "$3" ]; then