From e1be38f90dde70dcca57c382ac3f3a889bf9ef00 Mon Sep 17 00:00:00 2001 From: Nathan LaFreniere Date: Fri, 5 Oct 2012 11:39:38 -0700 Subject: [PATCH] fixup automatically prepending the v for remote requests --- nvm.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index b3ec60e..1804925 100755 --- a/nvm.sh +++ b/nvm.sh @@ -37,7 +37,7 @@ nvm_remote_version() { PATTERN=$1 VERSION=`nvm_ls_remote $PATTERN | tail -n1` - echo "v$VERSION" + echo "$VERSION" if [ "$VERSION" = 'N/A' ]; then return @@ -74,6 +74,11 @@ nvm_ls() nvm_ls_remote() { PATTERN=$1 + if [ "$PATTERN" ]; then + if [ "${PATTERN:0:1}" != "v" ]; then + PATTERN=v$PATTERN + fi + fi VERSIONS=`curl -s http://nodejs.org/dist/ \ | egrep -o 'v[0-9]+\.[0-9]+\.[0-9]+' \ | grep -w "${PATTERN}" \