Refactor nvm_remote_version to handle "lts" as a special case

This commit is contained in:
Reetik Rajan 2024-10-05 09:21:42 +05:30
parent da2720a429
commit 9895f4b48c

3
nvm.sh
View File

@ -748,6 +748,9 @@ nvm_remote_version() {
"$(nvm_iojs_prefix)")
VERSION="$(NVM_LTS="${NVM_LTS-}" nvm_ls_remote_iojs | command tail -1)" &&:
;;
"lts")
VERSION="$(NVM_LTS="lts/*" nvm_ls_remote | command tail -1)" &&:
;;
*)
VERSION="$(NVM_LTS="${NVM_LTS-}" nvm_ls_remote "${PATTERN}")" &&:
;;