From ebff66649e816414b4a7aacf85c16aa3cc2e673c Mon Sep 17 00:00:00 2001 From: Nathan LaFreniere Date: Thu, 4 Oct 2012 09:36:39 -0700 Subject: [PATCH] add v to version if user does not specify it to simplify commands --- nvm.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nvm.sh b/nvm.sh index 45bf52e..aab76d5 100755 --- a/nvm.sh +++ b/nvm.sh @@ -23,6 +23,10 @@ nvm_version() # The default version is the current one if [ ! "$PATTERN" ]; then PATTERN='current' + elif [ "${PATTERN:0:1}" != "v" ]; then + if [ "$PATTERN" != "default" -a "$PATTERN" != "current" ]; then + PATTERN=v$PATTERN + fi fi VERSION=`nvm_ls $PATTERN | tail -n1`