Merge pull request #432 from ajcrites/master

Only list extant explicit version
master
Jordan Harband 2014-06-12 11:55:56 -07:00
commit de03007348
2 changed files with 13 additions and 1 deletions

4
nvm.sh
View File

@ -130,7 +130,9 @@ nvm_ls() {
fi fi
# If it looks like an explicit version, don't do anything funny # If it looks like an explicit version, don't do anything funny
if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then
VERSIONS="$PATTERN" if [ -d "$NVM_DIR/$PATTERN" ]; then
VERSIONS="$PATTERN"
fi
else else
VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$(nvm_format_version $PATTERN)*" -exec basename '{}' ';' \ VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$(nvm_format_version $PATTERN)*" -exec basename '{}' ';' \
| sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | grep -v '^ *\.'` | sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | grep -v '^ *\.'`

View File

@ -0,0 +1,10 @@
#!/bin/sh
mkdir ../../../v0.1.2
. ../../../nvm.sh
nvm ls v0.1 | grep v0.1.2 &&
nvm ls v0.1.2 | grep v0.1.2 &&
nvm ls v0.1. | grep N/A &&
nvm ls v0.1.1 | grep N/A