Skip to content
Myr

[Fix] remove `nvm_supports_source_options`

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

Fixes #2387

authored by Jordan Harband · committed by Jordan Harband · parent 9849bf4 · Browse files · 2 files+8 added−45 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+8 added−45 removed

  • tests:+0 added−27 removed
  • other:+8 added−18 removed

2 files+8 added−45 removed

deleted:test/fast/Unit tests/nvm_supports_source_options-27 removed
1#!/bin/sh23die () { echo "$@" ; exit 1; }45\. ../../../nvm.sh67x=08i=09runs=510calls=50011first_result=false12if (nvm_supports_source_options && printf .); then13 first_result=true14fi15while [ $x -le $runs ]; do16 y=$x17 x=$(( x + 1 ))18 while [ $i -le $calls ]; do19 this_result=false20 if (nvm_supports_source_options && printf .); then21 this_result=true22 fi23 [ $this_result = $first_result ] || die "call ${i}, run ${y} got ${this_result}; expected ${first_result}"24 i=$(( i + 1 ))25 done26done27echo "${runs} runs of ${calls} calls succeeded"
modified:nvm.sh+8 added-18 removed
3929 unmodified lines
3930 nvm_print_npm_version nvm_install_latest_npm nvm_npm_global_modules \3931 nvm_has_system_node nvm_has_system_iojs \3932 nvm_download nvm_get_latest nvm_has nvm_install_default_packages nvm_get_default_packages \3933 nvm_curl_use_compression nvm_curl_version \3934 nvm_supports_source_options nvm_auto nvm_supports_xz \3934 nvm_auto nvm_supports_xz \3935 nvm_echo nvm_err nvm_grep nvm_cd \3936 nvm_die_on_prefix nvm_get_make_jobs nvm_get_minor_version \3937 nvm_has_solaris_binary nvm_is_merged_node_version \3938 nvm_is_natural_num nvm_is_version_installed \
73 unmodified lines
4012 return 14013 fi4014}40154016nvm_supports_source_options() {4017 # shellcheck disable=SC1091,SC22404018 [ "_$( . /dev/stdin yes 2> /dev/null <<'EOF'4019[ $# -gt 0 ] && nvm_echo $14020EOF4021 )" = "_yes" ]4022}40234016nvm_supports_xz() {4017 if [ -z "${1-}" ]; then4018 return 14019 fi
79 unmodified lines
40994100nvm_process_parameters() {4101 local NVM_AUTO_MODE4102 NVM_AUTO_MODE='use'4111 if nvm_supports_source_options; then4112 while [ $# -ne 0 ]; do4113 case "$1" in4114 --install) NVM_AUTO_MODE='install' ;;4115 --no-use) NVM_AUTO_MODE='none' ;;4116 esac4117 shift4118 done4103 while [ $# -ne 0 ]; do4104 case "$1" in4105 --install) NVM_AUTO_MODE='install' ;;4106 --no-use) NVM_AUTO_MODE='none' ;;4107 esac4108 shift4109 done4119 fi4110 nvm_auto "${NVM_AUTO_MODE}"4111}41124113nvm_process_parameters "$@"
2 unmodified lines