Make sure the new `versions` directory is filtered out of nvm_ls output (in zsh).

master
Jordan Harband 2014-08-21 22:54:26 -07:00
parent 7551746e55
commit b59ecb9e11
2 changed files with 15 additions and 1 deletions

2
nvm.sh
View File

@ -231,7 +231,7 @@ nvm_ls() {
fi
if [ -d "$(nvm_version_dir new)" ]; then
VERSIONS=`find "$(nvm_version_dir new)/" "$(nvm_version_dir old)/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \
| sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.' | \grep -e '^v'`
| sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.' | \grep -e '^v' | \grep -v -e '^versions$'`
else
VERSIONS=`find "$(nvm_version_dir old)/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \
| sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.' | \grep -e '^v'`

View File

@ -0,0 +1,14 @@
#!/bin/sh
mkdir ../../../v0.1.3
mkdir ../../../v0.2.3
. ../../../nvm.sh
mkdir ../../../versions
[ -z "$(nvm ls | \grep 'versions')" ]
# The result should contain only the appropriate version numbers.
rmdir ../../../versions