Skip to content

Commit

Permalink
Don't list uninstalled implicit aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 11, 2014
1 parent 8f76b35 commit e99645f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ nvm() {
local DEST
for ALIAS_PATH in "$NVM_DIR"/alias/"$2"*; do
ALIAS="$(basename "$ALIAS_PATH")"
DEST="$(nvm_alias "$ALIAS" 2&>1 > /dev/null)"
DEST="$(nvm_alias "$ALIAS" 2> /dev/null)"
if [ -n "$DEST" ]; then
VERSION="$(nvm_version "$DEST")"
if [ "_$DEST" = "_$VERSION" ]; then
Expand All @@ -906,8 +906,10 @@ nvm() {
if [ ! -f "$NVM_DIR/alias/$ALIAS" ]; then
if [ $# -lt 2 ] || [ "~$ALIAS" = "~$2" ]; then
DEST="$(nvm_print_implicit_alias local "$ALIAS")"
VERSION="$(nvm_version "$DEST")"
echo "$ALIAS -> $DEST (-> $VERSION) (default)"
if [ "_$DEST" != "_" ]; then
VERSION="$(nvm_version "$DEST")"
echo "$ALIAS -> $DEST (-> $VERSION) (default)"
fi
fi
fi
done
Expand Down

0 comments on commit e99645f

Please sign in to comment.