From 90714dcd3ec402f70bec38274aab42aba252d5dc Mon Sep 17 00:00:00 2001 From: Evan Meagher Date: Mon, 11 Apr 2011 16:07:04 -0700 Subject: [PATCH] Rm aliases that point to uninstalled versions. --- nvm.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 7d7f13a..5042609 100644 --- a/nvm.sh +++ b/nvm.sh @@ -148,12 +148,16 @@ nvm() cd "$NVM_DIR/src" && \ rm -f "node-$VERSION.tar.gz" 2>/dev/null && \ rm -rf "$NVM_DIR/$VERSION" 2>/dev/null) + echo "Uninstalled node $VERSION" - # TODO: Should rm any aliases that point to uninstalled version. + # Rm any aliases that point to uninstalled version. + for A in `grep -l $VERSION $NVM_DIR/alias/*` + do + nvm unalias `basename $A` + done # Run sync in order to restore version stub file in $NVM_DIR. nvm sync 1>/dev/null - echo "Uninstalled node $VERSION" ;; "deactivate" ) if [[ $PATH == *$NVM_DIR/*/bin* ]]; then