Skip to content
Myr

Merge pull request #366 from messju/nvm_version_fix

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

fixed nvm_version result when multiple versions match the given pattern

authored by Jordan Harband · committed by Jordan Harband · parents 3a21485, e46ee7b · Browse files · 2 files+24 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+24 added−1 removed

  • tests:+23 added−0 removed
  • other:+1 added−1 removed

2 files+24 added−1 removed

added:test/slow/install two versions and use the latest one+23 added
1#!/bin/sh23set -e4. ../../nvm.sh56# Remove the stuff we're clobbering.7[ -e ../../v0.10.25 ] && rm -R ../../v0.10.258[ -e ../../v0.10.26 ] && rm -R ../../v0.10.26910# Install from binary11nvm install 0.10.2512nvm install 0.10.261314# Check15[ -d ../../v0.10.25 ]16[ -d ../../v0.10.26 ]1718# Use the first one19nvm use 0.10.252021# Use the latest one22nvm use 0.1023node --version | grep v0.10.26
modified:nvm.sh+1 added-1 removed
49 unmodified lines
50 if [ -z "$PATTERN" ]; then51 PATTERN='current'52 fi5354 VERSION=`nvm_ls $PATTERN`54 VERSION=`nvm_ls $PATTERN | tail -n1`55 echo "$VERSION"5657 if [ "$VERSION" = 'N/A' ]; then58 return
502 unmodified lines