Skip to content
Myr

Merge pull request #432 from ajcrites/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Only list extant explicit version

authored by Jordan Harband · committed by Jordan Harband · parents 931cc45, 1b22c2e · Browse files · 2 files+13 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−1 removed

  • tests:+10 added−0 removed
  • other:+3 added−1 removed

2 files+13 added−1 removed

added:test/fast/Listing versions/Running "nvm ls" with node-like versioning vx.x.x should only list a matched version+10 added
1#!/bin/sh23mkdir ../../../v0.1.245. ../../../nvm.sh67nvm ls v0.1 | grep v0.1.2 &&8nvm ls v0.1.2 | grep v0.1.2 &&9nvm ls v0.1. | grep N/A &&10nvm ls v0.1.1 | grep N/A
modified:nvm.sh+3 added-1 removed
128 unmodified lines
129 return130 fi131 # If it looks like an explicit version, don't do anything funny132 if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then133 if [ -d "$NVM_DIR/$PATTERN" ]; then133 VERSIONS="$PATTERN"134 VERSIONS="$PATTERN"135 fi136 else137 VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$(nvm_format_version $PATTERN)*" -exec basename '{}' ';' \138 | sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | grep -v '^ *\.'`139 fi
505 unmodified lines