From 1d6145de5a69db9c3de2974ba687469304a37517 Mon Sep 17 00:00:00 2001 From: Fraser Tweedale Date: Fri, 21 Feb 2014 23:25:45 +1000 Subject: [PATCH] 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. --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index cc7a7a8..4f0c991 100755 --- a/nvm.sh +++ b/nvm.sh @@ -93,7 +93,7 @@ nvm_ls() { return fi # 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" else VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "v$PATTERN*" -exec basename '{}' ';' \