Use [0-9] instead of [[:digit:]] per https://github.com/creationix/nvm/pull/466#discussion_r14853668 - it's simpler (and probably more portable).
parent
4cfe62d3d1
commit
83efa2288d
4
nvm.sh
4
nvm.sh
|
@ -153,13 +153,13 @@ nvm_ls() {
|
|||
return
|
||||
fi
|
||||
# If it looks like an explicit version, don't do anything funny
|
||||
if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then
|
||||
if [ `expr "$PATTERN" : "v[0-9]*\.[0-9]*\.[0-9]*$"` != 0 ]; then
|
||||
if [ -d "$NVM_DIR/$PATTERN" ]; then
|
||||
VERSIONS="$PATTERN"
|
||||
fi
|
||||
else
|
||||
PATTERN=$(nvm_format_version $PATTERN)
|
||||
if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then
|
||||
if [ `expr "$PATTERN" : "v[0-9]*\.[0-9]*$"` != 0 ]; then
|
||||
PATTERN="$PATTERN."
|
||||
fi
|
||||
VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \
|
||||
|
|
Loading…
Reference in New Issue