From 991fb8504758833837a80f1a443cb7dd92a728b8 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 19 Sep 2014 10:09:45 -0700 Subject: [PATCH] Adding `nvm_version_greater_than_or_equal_to` --- nvm.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index 0e2a8a0..0d14cfb 100644 --- a/nvm.sh +++ b/nvm.sh @@ -112,6 +112,14 @@ nvm_version_greater() { [ $LHS -gt $RHS ]; } +nvm_version_greater_than_or_equal_to() { + local LHS + LHS=$(nvm_normalize_version "$1") + local RHS + RHS=$(nvm_normalize_version "$2") + [ $LHS -ge $RHS ]; +} + nvm_version_dir() { local NVM_USE_NEW_DIR NVM_USE_NEW_DIR="$1" @@ -849,7 +857,7 @@ nvm() { echo "0.16.1" ;; "unload" ) - unset -f nvm nvm_print_versions nvm_checksum nvm_ls_remote nvm_ls nvm_remote_version nvm_version nvm_rc_version nvm_version_greater > /dev/null 2>&1 + unset -f nvm nvm_print_versions nvm_checksum nvm_ls_remote nvm_ls nvm_remote_version nvm_version nvm_rc_version nvm_version_greater nvm_version_greater_than_or_equal_to > /dev/null 2>&1 unset RC_VERSION NVM_NODEJS_ORG_MIRROR NVM_DIR NVM_CD_FLAGS > /dev/null 2>&1 ;; * )