fix explicit version matching on FreeBSD

FreeBSD's regular expression library does not like the pattern used
for matching explicit version strings in `nvm_ls`.  Change the
pattern to something more specific that works on FreeBSD.
master
Fraser Tweedale 2014-02-21 23:25:45 +10:00
parent ca0c8a7f1d
commit 1d6145de5a
1 changed files with 1 additions and 1 deletions

2
nvm.sh
View File

@ -93,7 +93,7 @@ nvm_ls() {
return return
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.*.\?.*.\?.*$"` != 0 ]; then if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then
VERSIONS="$PATTERN" VERSIONS="$PATTERN"
else else
VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "v$PATTERN*" -exec basename '{}' ';' \ VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "v$PATTERN*" -exec basename '{}' ';' \