From b707d8b0721a7bd085d35e87793f348705832fea Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 28 Sep 2014 10:14:27 -0700 Subject: [PATCH] nvm_ls: format the version immediately, so that `nvm ls 0.0.1` doesn't return `nvm ls 0.0.10` --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index cf29cef..03ac31a 100644 --- a/nvm.sh +++ b/nvm.sh @@ -255,12 +255,12 @@ nvm_ls() { return fi # If it looks like an explicit version, don't do anything funny - if [ "_$(echo "$PATTERN" | cut -c1-1)" = "_v" ] && [ "_$(nvm_num_version_groups "$PATTERN")" = "_3" ]; then + PATTERN=$(nvm_format_version $PATTERN) + if [ "_$(echo "$PATTERN" | cut -c1-1)" = "_v" ] && [ "_$(nvm_num_version_groups "$PATTERN")" = "_3" ]; then if [ -d "$(nvm_version_path "$PATTERN")" ]; then VERSIONS="$PATTERN" fi else - PATTERN=$(nvm_format_version $PATTERN) if [ "_$PATTERN" != "_system" ]; then local NUM_VERSION_GROUPS NUM_VERSION_GROUPS="$(nvm_num_version_groups "$PATTERN")"