Skip to content
Myr

Properly handle nvm_print_implicit_alias splitting in zsh.

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

Hopefully fixes #546.

authored by Jordan Harband · committed by Jordan Harband · parent e99645f · Browse files · 2 files+18 added−2 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+18 added−2 removed

  • tests:+5 added−0 removed
  • other:+13 added−2 removed

2 files+18 added−2 removed

modified:test/fast/Unit tests/nvm_print_implicit_alias success+5 added
28 unmodified lines
29 echo "v0.5.4"30 echo "v0.6.6"31 echo "v0.7.7"32 echo "v0.9.7"33 echo "v0.4.3"34 echo "v0.5.4"35 echo "v0.6.6"36 echo "v0.7.7"37 echo "v0.9.7"38}3940LATEST_STABLE="$(nvm_print_implicit_alias remote stable)"41[ "_$LATEST_STABLE" = "_0.6" ] || die "remote stable is not latest even minor: expected 0.6, got $LATEST_STABLE"
6 unmodified lines
modified:nvm.sh+13 added-2 removed
410 unmodified lines
411 fi412413 local LAST_TWO414 if [ "_$1" = "_local" ]; then415 LAST_TWO="$(nvm_ls | \grep -e '^v' | cut -c2- | cut -d . -f 1,2 | uniq)"415 LAST_TWO=$(nvm_ls | \grep -e '^v' | cut -c2- | cut -d . -f 1,2 | uniq)416 else417 LAST_TWO="$(nvm_ls_remote | \grep -e '^v' | cut -c2- | cut -d . -f 1,2 | uniq)"417 LAST_TWO=$(nvm_ls_remote | \grep -e '^v' | cut -c2- | cut -d . -f 1,2 | uniq)418 fi419 local MINOR420 local STABLE421 local UNSTABLE422 local MOD423424 local ZHS_HAS_SHWORDSPLIT_UNSET425 ZHS_HAS_SHWORDSPLIT_UNSET=1426 if nvm_has "setopt"; then427 ZHS_HAS_SHWORDSPLIT_UNSET=$(setopt | \grep shwordsplit > /dev/null ; echo $?)428 setopt shwordsplit429 fi430 for MINOR in $LAST_TWO; do431 MOD=$(expr "$(nvm_normalize_version "$MINOR")" \/ 1000000 \% 2)432 if [ $MOD -eq 0 ]; then433 STABLE="$MINOR"434 elif [ $MOD -eq 1 ]; then435 UNSTABLE="$MINOR"436 fi437 done438 if [ $ZHS_HAS_SHWORDSPLIT_UNSET -eq 1 ] && nvm_has "unsetopt"; then439 unsetopt shwordsplit440 fi441442 if [ "_$2" = "_stable" ]; then443 echo $STABLE444 elif [ "_$2" = "_unstable" ]; then445 echo $UNSTABLE
562 unmodified lines