Fixing `nvm ls 0.x` to only include `0.x.*` instead of `0.x*.*`
parent
802f064178
commit
4cfe62d3d1
6
nvm.sh
6
nvm.sh
|
@ -158,7 +158,11 @@ nvm_ls() {
|
||||||
VERSIONS="$PATTERN"
|
VERSIONS="$PATTERN"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$(nvm_format_version $PATTERN)*" -exec basename '{}' ';' \
|
PATTERN=$(nvm_format_version $PATTERN)
|
||||||
|
if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then
|
||||||
|
PATTERN="$PATTERN."
|
||||||
|
fi
|
||||||
|
VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \
|
||||||
| sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.'`
|
| sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.'`
|
||||||
fi
|
fi
|
||||||
if [ -z "$VERSIONS" ]; then
|
if [ -z "$VERSIONS" ]; then
|
||||||
|
|
Loading…
Reference in New Issue