Ensure nvm_version node and nvm_version node- report the latest stable node version.

This commit is contained in:
Jordan Harband
2015-01-19 10:05:36 -08:00
parent 247bd310ef
commit f1f11e3b7a
2 changed files with 7 additions and 1 deletions

5
nvm.sh
View File

@@ -199,6 +199,11 @@ nvm_version() {
return $?
fi
case "_$PATTERN" in
"_$(nvm_node_prefix)" | "_$(nvm_node_prefix)-")
PATTERN="stable"
;;
esac
VERSION="$(nvm_ls "$PATTERN" | tail -n1)"
if [ -z "$VERSION" ] || [ "_$VERSION" = "_N/A" ]; then
echo "N/A"