From a1c0c34088f67ff0884134ceded8a00148d674b2 Mon Sep 17 00:00:00 2001 From: Daniel Bretoi Date: Tue, 2 Dec 2014 12:58:07 -0800 Subject: [PATCH] fix to proper echo of nvm which. Checkin test which had been left out --- nvm.sh | 2 +- ... foo\" should return a nonzero exit code when not found" | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 "test/fast/Listing paths/Running \"nvm which foo\" should return a nonzero exit code when not found" diff --git a/nvm.sh b/nvm.sh index e3f4b3b..9a42199 100644 --- a/nvm.sh +++ b/nvm.sh @@ -968,7 +968,7 @@ nvm() { if [ "_$VERSION" = '_system' ]; then if nvm_has_system_node >/dev/null 2>&1; then - echo $(dirname `which node`) + echo $(nvm use system && echo dirname $(which node)) return else echo "System version of node not found." >&2 diff --git "a/test/fast/Listing paths/Running \"nvm which foo\" should return a nonzero exit code when not found" "b/test/fast/Listing paths/Running \"nvm which foo\" should return a nonzero exit code when not found" new file mode 100755 index 0000000..43b2bae --- /dev/null +++ "b/test/fast/Listing paths/Running \"nvm which foo\" should return a nonzero exit code when not found" @@ -0,0 +1,6 @@ + #!/bin/sh + +. ../../../nvm.sh + +nvm which nonexistent_version +[ "$?" = "1" ]