Skip to content
Myr

Use [0-9] instead of [[:digit:]] per https://github.com/creationix/nvm/pull/466#discussion_r14853668 - it's simpler (and probably more portable).

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jordan Harband · committed by Jordan Harband · parent 4cfe62d · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:nvm.sh+2 added-2 removed
151 unmodified lines
152 nvm_version `cat $NVM_DIR/alias/$PATTERN`153 return154 fi155 # If it looks like an explicit version, don't do anything funny156 if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then156 if [ `expr "$PATTERN" : "v[0-9]*\.[0-9]*\.[0-9]*$"` != 0 ]; then157 if [ -d "$NVM_DIR/$PATTERN" ]; then158 VERSIONS="$PATTERN"159 fi160 else161 PATTERN=$(nvm_format_version $PATTERN)162 if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then162 if [ `expr "$PATTERN" : "v[0-9]*\.[0-9]*$"` != 0 ]; then163 PATTERN="$PATTERN."164 fi165 VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \166 | sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.'`
524 unmodified lines