Merge pull request #146 from nathan-lafreniere/master

fixup prepending of the v in ls-remote
master
Tim Caswell 2012-10-05 21:13:29 -07:00
commit 5a17b81a09
1 changed files with 6 additions and 1 deletions

7
nvm.sh
View File

@ -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}" \