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
parent
ca0c8a7f1d
commit
1d6145de5a
2
nvm.sh
2
nvm.sh
|
@ -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 '{}' ';' \
|
||||||
|
|
Loading…
Reference in New Issue