add v to version if user does not specify it to simplify commands

master
Nathan LaFreniere 2012-10-04 09:36:39 -07:00
parent 07aaa91c9b
commit ebff66649e
1 changed files with 4 additions and 0 deletions

4
nvm.sh
View File

@ -23,6 +23,10 @@ nvm_version()
# The default version is the current one # The default version is the current one
if [ ! "$PATTERN" ]; then if [ ! "$PATTERN" ]; then
PATTERN='current' PATTERN='current'
elif [ "${PATTERN:0:1}" != "v" ]; then
if [ "$PATTERN" != "default" -a "$PATTERN" != "current" ]; then
PATTERN=v$PATTERN
fi
fi fi
VERSION=`nvm_ls $PATTERN | tail -n1` VERSION=`nvm_ls $PATTERN | tail -n1`