mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-10-31 01:45:50 +08:00
nvm_num_version_groups should report 0 when given just a v or a .
This commit is contained in:
4
nvm.sh
4
nvm.sh
@@ -333,12 +333,12 @@ nvm_format_version() {
|
||||
nvm_num_version_groups() {
|
||||
local VERSION
|
||||
VERSION="$1"
|
||||
VERSION="${VERSION#v}"
|
||||
VERSION="${VERSION%.}"
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "0"
|
||||
return
|
||||
fi
|
||||
VERSION="${VERSION#v*}"
|
||||
VERSION="${VERSION%\.}"
|
||||
local NVM_NUM_DOTS
|
||||
NVM_NUM_DOTS=$(echo "$VERSION" | command sed -e 's/[^\.]//g')
|
||||
local NVM_NUM_GROUPS
|
||||
|
||||
Reference in New Issue
Block a user