mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 22:31:51 +00:00
Fixing nvm ls 0.x
to only include 0.x.*
instead of 0.x*.*
This commit is contained in:
parent
802f064178
commit
4cfe62d3d1
6
nvm.sh
6
nvm.sh
@ -158,7 +158,11 @@ nvm_ls() {
|
||||
VERSIONS="$PATTERN"
|
||||
fi
|
||||
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 '^ *\.'`
|
||||
fi
|
||||
if [ -z "$VERSIONS" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user