File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4328,7 +4328,7 @@ nvm() {
43284328
43294329 local NVM_OUTPUT
43304330 local EXIT_CODE
4331- NVM_OUTPUT=" $( NVM_LTS=" ${NVM_LTS-} " nvm_remote_versions " ${PATTERN} " && :) "
4331+ NVM_OUTPUT=" $( NVM_LTS=" ${NVM_LTS-} " nvm_remote_versions " ${PATTERN- } " && :) "
43324332 EXIT_CODE=$?
43334333 if [ -n " ${NVM_OUTPUT} " ]; then
43344334 NVM_NO_COLORS=" ${NVM_NO_COLORS-} " nvm_print_versions " ${NVM_OUTPUT} "
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ die () { echo " $@ " ; cleanup ; exit 1; }
4+
5+ cleanup () {
6+ unset -f nvm_download nvm_ls_remote nvm_ls_remote_iojs
7+ }
8+
9+ : nvm.sh
10+ \. ../../../nvm.sh
11+
12+ \. ../../common.sh
13+
14+ REMOTE=" ${PWD} /mocks/nvm_ls_remote.txt"
15+ nvm_ls_remote () {
16+ cat " ${REMOTE} "
17+ }
18+ REMOTE_IOJS=" ${PWD} /mocks/nvm_ls_remote_iojs.txt"
19+ nvm_ls_remote_iojs () {
20+ cat " ${REMOTE_IOJS} "
21+ }
22+
23+ # Enable no unset variable; regression test for https://github.com/nvm-sh/nvm/issues/3820
24+ set -u
25+
26+ # Bare `nvm ls-remote` (no pattern argument) must not error on unset PATTERN
27+ output=$( nvm ls-remote 2>&1 1> /dev/null) || die " nvm ls-remote with nounset failed: ${output} "
28+ test -z " ${output} " || die " expected empty stderr; got >${output} <"
29+
30+ cleanup
You can’t perform that action at this time.
0 commit comments