Skip to content
Myr

[Fix] `nvm_ls`: zsh: unset `markdirs` and `local_options`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixes #2315.

authored by Dylan Armstrong · committed by Jordan Harband · parent 4436638 · Browse files · 2 files+41 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+41 added−0 removed

  • tests:+40 added−0 removed
  • other:+1 added−0 removed

2 files+41 added−0 removed

added:test/fast/Listing versions/Running "nvm ls" should not show a trailing slash+40 added
1#!/bin/zsh23\. ../../../nvm.sh4\. ../../common.sh56if type setopt >/dev/null 2>&1; then setopt local_options markdirs; fi78die () {9 if type unsetopt >/dev/null 2>&1; then unsetopt local_options markdirs; fi10 echo "$@";11 exit 1;12}1314make_fake_node v0.0.115make_fake_node v0.0.316make_fake_node v0.0.917make_fake_node v0.3.118make_fake_node v0.3.319make_fake_node v0.3.920make_fake_node v0.12.8721make_fake_node v0.12.922make_fake_iojs v0.1.223make_fake_iojs v0.10.22425OUTPUT="$(nvm_ls)"26EXPECTED_OUTPUT="v0.0.127v0.0.328v0.0.929iojs-v0.1.230v0.3.131v0.3.332v0.3.933iojs-v0.10.234v0.12.935v0.12.87"36if nvm_has_system_node || nvm_has_system_iojs; then37 EXPECTED_OUTPUT="${EXPECTED_OUTPUT}38system"39fi40[ "${OUTPUT-}" = "${EXPECTED_OUTPUT-}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
modified:nvm.sh+1 added
1087 unmodified lines
1088 ;;1089 esac10901091 nvm_is_zsh && setopt local_options shwordsplit1092 nvm_is_zsh && unsetopt local_options markdirs10931094 local NVM_DIRS_TO_SEARCH11095 NVM_DIRS_TO_SEARCH1=''1096 local NVM_DIRS_TO_SEARCH2
2772 unmodified lines