mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-07-21 06:13:51 +08:00
[Fix] nvm uninstall: fix alias cleanup glob expansion
The `*` glob was inside double quotes, preventing shell expansion. `nvm_grep -l` received a literal `*` filename instead of the list of alias files, so aliases pointing to uninstalled versions were never cleaned up. Bug introduced in https://github.com/nvm-sh/nvm/commit/7807a9f09e54a14f9b493c6eeda0022489cda496.
This commit is contained in:
@@ -3906,7 +3906,7 @@ nvm() {
|
||||
nvm_echo "${NVM_SUCCESS_MSG}"
|
||||
|
||||
# rm any aliases that point to uninstalled version.
|
||||
for ALIAS in $(nvm_grep -l "${VERSION}" "$(nvm_alias_path)/*" 2>/dev/null); do
|
||||
for ALIAS in $(nvm_grep -l "${VERSION}" "$(nvm_alias_path)"/* 2>/dev/null); do
|
||||
nvm unalias "$(command basename "${ALIAS}")"
|
||||
done
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user