Skip to content
Myr

Fix a bug in nvm_remote_version that was breaking `nvm install stable`/`nvm install unstable`.

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

Fixes #630.

authored by Jordan Harband · committed by Jordan Harband · parent 8822bd7 · Browse files · 2 files+19 added−10 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+19 added−10 removed

  • tests:+18 added−9 removed
  • other:+1 added−1 removed

2 files+19 added−10 removed

modified:test/fast/Unit tests/nvm_remote_version+18 added-9 removed
24 unmodified lines
25[ "_$EXIT_CODE" = "_3" ] || die "nonexistent version did not exit with code 3, got $EXIT_CODE"262728nvm_ls_remote() {29 if ! nvm_is_iojs_version "$1"; then29 echo "test output"30 echo "more test output"31 echo "pattern received: _$1_"30 echo "test output"31 echo "more test output"32 echo "pattern received: _$1_"33 fi34}35nvm_ls_remote_iojs() {36 if nvm_is_iojs_version "$1"; then37 echo "test iojs output"38 echo "more iojs test output"39 echo "iojs pattern received: _$1_"40 fi41}42OUTPUT="$(nvm_remote_version foo)"43EXIT_CODE="$(nvm_remote_version foo >/dev/null 2>&1 ; echo $?)"44[ "_$OUTPUT" = "_pattern received: _foo_" ] \45 || die "nvm_remote_version foo did not return last line only of nvm_ls_remote foo; got $OUTPUT"46[ "_$EXIT_CODE" = "_0" ] || die "nvm_remote_version foo did not exit with 0, got $EXIT_CODE"4739nvm_ls_remote_iojs() {40 echo "test iojs output"41 echo "more iojs test output"42 echo "iojs pattern received: _$1_"4344}48OUTPUT="$(nvm_remote_version iojs-foo)"49EXIT_CODE="$(nvm_remote_version iojs-foo >/dev/null 2>&1 ; echo $?)"50[ "_$OUTPUT" = "_iojs pattern received: _iojs-foo_" ] \51 || die "nvm_remote_version iojs-foo did not return last line only of nvm_ls_remote_iojs foo; got $OUTPUT"52[ "_$EXIT_CODE" = "_0" ] || die "nvm_remote_version iojs-foo did not exit with 0, got $EXIT_CODE"5354OUTPUT="$(nvm_remote_version stable)"55EXIT_CODE="$(nvm_remote_version stable >/dev/null 2>&1 ; echo $?)"56[ "_$OUTPUT" = "_$(nvm_ls_remote stable)" ] \57 || die "nvm_remote_version stable did not return contents of nvm_ls_remote stable; got $OUTPUT"58[ "_$EXIT_CODE" = "_0" ] || die "nvm_remote_version stable did not exit with 0, got $EXIT_CODE"5960cleanup61
modified:nvm.sh+1 added-1 removed
216 unmodified lines
217 local PATTERN218 PATTERN="$1"219 local VERSION220 if nvm_validate_implicit_alias "$PATTERN" 2> /dev/null ; then221 VERSIONS="$(nvm_ls_remote "$PATTERN")"221 VERSION="$(nvm_ls_remote "$PATTERN")"222 else223 case "_$PATTERN" in224 "_$(nvm_node_prefix)")225 VERSION="$(nvm_ls_remote stable)"
1315 unmodified lines