`nvm unalias`: Provide a restore command when unaliasing.

Fixes #916.
Jordan Harband 2015-12-13 21:34:28 -08:00
parent 896199facc
commit 04c5e3540e
1 changed files with 3 additions and 1 deletions

4
nvm.sh
View File

@ -2163,8 +2163,10 @@ $NVM_LS_REMOTE_POST_MERGED_OUTPUT" | command grep -v "N/A" | command sed '/^$/d'
return 127
fi
[ ! -f "$NVM_ALIAS_DIR/$2" ] && echo "Alias $2 doesn't exist!" >&2 && return
local NVM_ALIAS_ORIGINAL
NVM_ALIAS_ORIGINAL="$(nvm_alias "$2")"
command rm -f "$NVM_ALIAS_DIR/$2"
echo "Deleted alias $2"
echo "Deleted alias $2 - restore it with \`nvm alias $2 "$NVM_ALIAS_ORIGINAL"\`"
;;
"reinstall-packages" | "copy-packages" )
if [ $# -ne 2 ]; then