Skip to content
Myr

If `nvm_ls` is called without a pattern, and node exists, tack on "system".

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

authored by Jordan Harband · committed by Jordan Harband · parent 42b0107 · Browse files · 2 files+24 added−0 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−0 removed

  • tests:+21 added−0 removed
  • other:+3 added−0 removed

2 files+24 added−0 removed

added:test/fast/Listing versions/Running "nvm ls" should include "system" when appropriate+21 added
1#!/bin/sh23die () { echo $@ ; exit 1; }45. ../../../nvm.sh67mkdir -p ../../../v0.0.18mkdir -p ../../../v0.0.39mkdir -p ../../../v0.0.910mkdir -p ../../../v0.3.111mkdir -p ../../../v0.3.312mkdir -p ../../../v0.3.91314nvm_has_system_node() { return 0; }15nvm ls | grep system 2>&1 > /dev/null16[ $? -eq 0 ] || die '"nvm ls" did not contain "system" when system node is present'1718nvm_has_system_node() { return 1; }19nvm ls | grep system 2>&1 > /dev/null20[ $? -ne 0 ] || die '"nvm ls" contained "system" when system node is not present'21
modified:nvm.sh+3 added
192 unmodified lines
193 if [ -z "$VERSIONS" ]; then194 echo "N/A"195 return 3196 fi197 if [ -z "$PATTERN" ] && nvm_has_system_node; then198 VERSIONS="$VERSIONS$(printf '\n%s' 'system')"199 fi200 echo "$VERSIONS"201 return202}203
518 unmodified lines