mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-09-14 00:00:08 +08:00
[Fix] nvm which: show alias name in infinite loop error message
`${2}` was empty because positional parameters had been consumed by `shift` in the argument parsing loop.
Use `${provided_version}` which holds the resolved alias name.
Bug introduced in https://github.com/nvm-sh/nvm/commit/1c00753fd9c3ae5e0bb3f4992c5e283ef5bf5085.
This commit is contained in:
@@ -4374,7 +4374,7 @@ nvm() {
|
||||
nvm_err 'System version of node not found.'
|
||||
return 127
|
||||
elif [ "${VERSION}" = '∞' ]; then
|
||||
nvm_err "The alias \"${2}\" leads to an infinite loop. Aborting."
|
||||
nvm_err "The alias \"${provided_version}\" leads to an infinite loop. Aborting."
|
||||
return 8
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user