From 5ef092b2c840faf32238c554e3b6dd0caa02de8c Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 19 Sep 2014 10:10:37 -0700 Subject: [PATCH] Using `nvm_version_greater` and `nvm_version_greater_than_or_equal_to` instead of `expr` in `nvm install`. --- nvm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nvm.sh b/nvm.sh index 345ff44..1c0845e 100644 --- a/nvm.sh +++ b/nvm.sh @@ -559,10 +559,10 @@ nvm() { nvm use $VERSION if ! nvm_has "npm" ; then echo "Installing npm..." - if [ "`expr "$VERSION" : '\(^v0\.1\.\)'`" != '' ]; then + if nvm_version_greater 0.2.0 "$VERSION"; then echo "npm requires node v0.2.3 or higher" >&2 - elif [ "`expr "$VERSION" : '\(^v0\.2\.\)'`" != '' ]; then - if [ "`expr "$VERSION" : '\(^v0\.2\.[0-2]$\)'`" != '' ]; then + elif nvm_version_greater_than_or_equal_to "$VERSION" 0.2.0; then + if nvm_version_greater 0.2.3 "$VERSION"; then echo "npm requires node v0.2.3 or higher" >&2 else nvm_download https://npmjs.org/install.sh -o - | clean=yes npm_install=0.2.19 sh