From c46748a379c80302258664b6e3a5a79f3b73c9c1 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 13 Jan 2015 14:16:35 -0800 Subject: [PATCH] Add `nvm_node_prefix` --- nvm.sh | 5 ++++- test/fast/Unit tests/nvm_node_prefix | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 test/fast/Unit tests/nvm_node_prefix diff --git a/nvm.sh b/nvm.sh index 81797b0..5ce9e0b 100644 --- a/nvm.sh +++ b/nvm.sh @@ -350,6 +350,9 @@ nvm_resolve_alias() { nvm_iojs_prefix() { echo "iojs" } +nvm_node_prefix() { + echo "node" +} nvm_ls() { local PATTERN @@ -1194,7 +1197,7 @@ nvm() { ;; "unload" ) unset -f nvm nvm_print_versions nvm_checksum \ - nvm_iojs_prefix \ + nvm_iojs_prefix nvm_node_prefix \ nvm_ls_remote nvm_ls nvm_remote_version \ nvm_version nvm_rc_version \ nvm_version_greater nvm_version_greater_than_or_equal_to \ diff --git a/test/fast/Unit tests/nvm_node_prefix b/test/fast/Unit tests/nvm_node_prefix new file mode 100755 index 0000000..a0bc098 --- /dev/null +++ b/test/fast/Unit tests/nvm_node_prefix @@ -0,0 +1,7 @@ +#!/bin/sh + +die () { echo $@ ; exit 1; } + +. ../../../nvm.sh + +[ "$(nvm_node_prefix)" = "node" ] || die '"nvm_node_prefix" did not return the string "node". why did this fail?!'