Use `nvm_alias` in `nvm alias`
parent
66b214651f
commit
d0c6b87b2e
11
nvm.sh
11
nvm.sh
|
@ -890,14 +890,15 @@ nvm() {
|
||||||
mkdir -p "$NVM_DIR/alias"
|
mkdir -p "$NVM_DIR/alias"
|
||||||
if [ $# -le 2 ]; then
|
if [ $# -le 2 ]; then
|
||||||
local DEST
|
local DEST
|
||||||
for ALIAS in "$NVM_DIR"/alias/"$2"*; do
|
for ALIAS_PATH in "$NVM_DIR"/alias/"$2"*; do
|
||||||
if [ -e "$ALIAS" ]; then
|
ALIAS="$(basename "$ALIAS_PATH")"
|
||||||
DEST="$(cat "$ALIAS")"
|
DEST="$(nvm_alias "$ALIAS" 2>1 /dev/null)"
|
||||||
|
if [ -n "$DEST" ]; then
|
||||||
VERSION="$(nvm_version "$DEST")"
|
VERSION="$(nvm_version "$DEST")"
|
||||||
if [ "_$DEST" = "_$VERSION" ]; then
|
if [ "_$DEST" = "_$VERSION" ]; then
|
||||||
echo "$(basename "$ALIAS") -> $DEST"
|
echo "$ALIAS -> $DEST"
|
||||||
else
|
else
|
||||||
echo "$(basename "$ALIAS") -> $DEST (-> $VERSION)"
|
echo "$ALIAS -> $DEST (-> $VERSION)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue