From 5048a783760c78c15a6eaf87e2c935bb50689dc4 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 26 Aug 2014 23:53:17 -0700 Subject: [PATCH] Add special handling for node v0.6.21-pre --- nvm.sh | 8 +++++++- ...nvm current\" should display current nvm environment." | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index 500e472..fd41235 100644 --- a/nvm.sh +++ b/nvm.sh @@ -205,7 +205,13 @@ nvm_ls_current() { if [ $? -ne 0 ]; then echo 'none' elif nvm_tree_contains_path "$NVM_DIR" "$NODE_PATH"; then - echo `node -v 2>/dev/null` + local VERSION + VERSION=`node -v 2>/dev/null` + if [ "$VERSION" = "v0.6.21-pre" ]; then + echo "v0.6.21" + else + echo "$VERSION" + fi else echo 'system' fi diff --git "a/test/slow/Running \"nvm current\" should display current nvm environment." "b/test/slow/Running \"nvm current\" should display current nvm environment." index de82ceb..bf43802 100755 --- "a/test/slow/Running \"nvm current\" should display current nvm environment." +++ "b/test/slow/Running \"nvm current\" should display current nvm environment." @@ -8,3 +8,7 @@ nvm install 0.10 [ "$(nvm current)" = "$(node -v)" ] || die "Failed to find current version: got \"$(nvm current)\", expected \"$(node -v)\"" +nvm install 0.6.21 +[ "$(node -v)" = "v0.6.21-pre" ] || die "v0.6.21-pre not installed with v0.6.21" +[ "$(nvm current)" = "v0.6.21" ] || die "v0.6.21-pre not reported as v0.6.21" +