mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 22:31:51 +00:00
Rm aliases that point to uninstalled versions.
This commit is contained in:
parent
d24f7ca880
commit
90714dcd3e
8
nvm.sh
8
nvm.sh
@ -148,12 +148,16 @@ nvm()
|
|||||||
cd "$NVM_DIR/src" && \
|
cd "$NVM_DIR/src" && \
|
||||||
rm -f "node-$VERSION.tar.gz" 2>/dev/null && \
|
rm -f "node-$VERSION.tar.gz" 2>/dev/null && \
|
||||||
rm -rf "$NVM_DIR/$VERSION" 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.
|
# Run sync in order to restore version stub file in $NVM_DIR.
|
||||||
nvm sync 1>/dev/null
|
nvm sync 1>/dev/null
|
||||||
echo "Uninstalled node $VERSION"
|
|
||||||
;;
|
;;
|
||||||
"deactivate" )
|
"deactivate" )
|
||||||
if [[ $PATH == *$NVM_DIR/*/bin* ]]; then
|
if [[ $PATH == *$NVM_DIR/*/bin* ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user