Filter out of `nvm ls` things that start with a dot. Fixes #421, closes #422.

master
Jordan Harband 2014-05-20 10:36:12 -07:00
parent 896aa7c436
commit 578a601b27
2 changed files with 10 additions and 1 deletions

2
nvm.sh
View File

@ -133,7 +133,7 @@ nvm_ls() {
VERSIONS="$PATTERN"
else
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`
| sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | grep -v '^ *\.'`
fi
if [ -z "$VERSIONS" ]; then
echo "N/A"

View File

@ -0,0 +1,9 @@
#!/bin/sh
mkdir ../../../v0.1.3
mkdir ../../../v0.2.3
. ../../../nvm.sh
[ -z `nvm ls | grep '^ *\.'` ]
# The result should contain only the appropriate version numbers.