ls-remote: introduce temp var for env inheritance

This is to inherit $NVM_MIN from env when defined, meanwhile avoiding
inline local variable initialization for ksh compatibility.

Co-authored-by: Jordan Harband <ljharb@gmail.com>
This commit is contained in:
ryenus 2024-07-15 14:55:33 +08:00
parent e71918ec8c
commit c02964100e

6
nvm.sh
View File

@ -4135,10 +4135,12 @@ nvm() {
;;
"ls-remote" | "list-remote")
local NVM_LTS
local NVM_MIN
NVM_MIN="${NVM_MIN-}"
local PATTERN
local NVM_NO_COLORS
local NVM_MIN_ENV
NVM_MIN_ENV="${NVM_MIN-}"
local NVM_MIN
NVM_MIN="${NVM_MIN_ENV-}"
while [ $# -gt 0 ]; do
case "${1-}" in