From 2116d2ff911900f837a75e08016796257498a181 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 2 Feb 2015 17:07:16 -0800 Subject: [PATCH] Filter out the io.js version dir from nvm_ls output. Fixes #642. --- nvm.sh | 1 + .../Running \"nvm ls io\" should return NA" | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100755 "test/fast/Listing versions/Running \"nvm ls io\" should return NA" diff --git a/nvm.sh b/nvm.sh index a0bfa8d..c2056f7 100644 --- a/nvm.sh +++ b/nvm.sh @@ -541,6 +541,7 @@ nvm_ls() { fi VERSIONS="$(command find $NVM_DIRS_TO_SEARCH -maxdepth 1 -type d -name "$PATTERN*" \ | command sed "s#$(nvm_version_dir iojs)/#"$(nvm_iojs_prefix)"-#" \ + | command grep -v "$(nvm_version_dir iojs)" \ | command sed "s#^$NVM_DIR/##" \ | command grep -v -e '^versions$' \ | command sed 's#^versions/##' \ diff --git "a/test/fast/Listing versions/Running \"nvm ls io\" should return NA" "b/test/fast/Listing versions/Running \"nvm ls io\" should return NA" new file mode 100755 index 0000000..ddd1123 --- /dev/null +++ "b/test/fast/Listing versions/Running \"nvm ls io\" should return NA" @@ -0,0 +1,7 @@ + #!/bin/sh + +. ../../../nvm.sh + +nvm ls io +[ "$?" = "3" ] +