From 8be97c8abb321877df2e628601f6cee937a13e7f Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 12 Jan 2015 18:15:04 -0800 Subject: [PATCH] Add `nvm_iojs_prefix` --- nvm.sh | 11 ++++++++++- test/fast/Unit tests/nvm_iojs_prefix | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 test/fast/Unit tests/nvm_iojs_prefix diff --git a/nvm.sh b/nvm.sh index 0f2db7e..81797b0 100644 --- a/nvm.sh +++ b/nvm.sh @@ -347,6 +347,10 @@ nvm_resolve_alias() { return 2 } +nvm_iojs_prefix() { + echo "iojs" +} + nvm_ls() { local PATTERN PATTERN="$1" @@ -1189,7 +1193,12 @@ nvm() { echo "0.22.2" ;; "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 nvm_version_greater_than_or_equal_to nvm_supports_source_options > /dev/null 2>&1 + unset -f nvm nvm_print_versions nvm_checksum \ + nvm_iojs_prefix \ + nvm_ls_remote nvm_ls nvm_remote_version \ + nvm_version nvm_rc_version \ + nvm_version_greater nvm_version_greater_than_or_equal_to \ + nvm_supports_source_options > /dev/null 2>&1 unset RC_VERSION NVM_NODEJS_ORG_MIRROR NVM_DIR NVM_CD_FLAGS > /dev/null 2>&1 ;; * ) diff --git a/test/fast/Unit tests/nvm_iojs_prefix b/test/fast/Unit tests/nvm_iojs_prefix new file mode 100755 index 0000000..6666695 --- /dev/null +++ b/test/fast/Unit tests/nvm_iojs_prefix @@ -0,0 +1,7 @@ +#!/bin/sh + +die () { echo $@ ; exit 1; } + +. ../../../nvm.sh + +[ "$(nvm_iojs_prefix)" = "iojs" ] || die '"nvm_iojs_prefix" did not return the string "iojs". why did this fail?!'