Make nvm ls system work.

This commit is contained in:
Jordan Harband
2014-09-05 00:10:51 -07:00
parent a7108e98f2
commit 110e571c34
2 changed files with 32 additions and 3 deletions

13
nvm.sh
View File

@@ -249,13 +249,20 @@ nvm_ls() {
| sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.' | \grep -e '^v'`
fi
fi
if nvm_has_system_node; then
if [ -z "$PATTERN" ]; then
VERSIONS="$VERSIONS$(printf '\n%s' 'system')"
elif [ "$PATTERN" = 'system' ]; then
VERSIONS="$(printf '%s' 'system')"
fi
fi
if [ -z "$VERSIONS" ]; then
echo "N/A"
return 3
fi
if [ -z "$PATTERN" ] && nvm_has_system_node; then
VERSIONS="$VERSIONS$(printf '\n%s' 'system')"
fi
echo "$VERSIONS"
return
}