mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-09 21:19:09 +00:00
Fixing nvm ls 0.x
to only include 0.x.*
instead of 0.x*.*
This commit is contained in:
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
|
||||
|
Reference in New Issue
Block a user