Skip to content
Myr

[shellcheck] remove duplicate function

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

authored by Jordan Harband · committed by Jordan Harband · parent 4c4b0d6 · Browse files · 1 file+4 added−12 removed
This commit

State

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

Diff stats

1 file+4 added−12 removed

  • other:+4 added−12 removed

1 file+4 added−12 removed

modified:nvm.sh+4 added-12 removed
371 unmodified lines
372 if [ -n "${BASH_SOURCE-}" ]; then373 # shellcheck disable=SC2169,SC3054374 NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"375 fi376 # shellcheck disable=SC2086377 NVM_DIR="$(nvm_cd ${NVM_CD_FLAGS} "$(dirname "${NVM_SCRIPT_SOURCE:-$0}")" >/dev/null && \pwd)"378 export NVM_DIR379else380 # https://unix.stackexchange.com/a/198289
312 unmodified lines
693 return 3694 fi695 # the `sed` is to remove trailing whitespaces (see "weird behavior" ~25 lines up)696 nvm_echo "${VERSIONS}" | command sed 's/ *$//g'697 # shellcheck disable=SC2317698 return $NVM_LS_REMOTE_EXIT_CODE || $NVM_LS_REMOTE_IOJS_EXIT_CODE699}700701nvm_is_valid_version() {
185 unmodified lines
887 nvm_echo "${TEXT}"888 fi889}890889nvm_wrap_with_color_code() {890 local CODE891 CODE="$(nvm_print_color_code "${1}" 2>/dev/null ||:)"892 local TEXT893 TEXT="${2-}"894 if nvm_has_colors && [ -n "${CODE}" ]; then895 nvm_echo_with_colors "\033[${CODE}${TEXT}\033[0m"896 else897 nvm_echo "${TEXT}"898 fi899}900891nvm_print_color_code() {892 case "${1-}" in893 '0') return 0 ;;894 'r') nvm_echo '0;31m' ;;
2895 unmodified lines
37903791 nvm_ensure_version_installed "${provided_version}"3792 EXIT_CODE=$?3793 if [ "${EXIT_CODE}" != "0" ]; then3794 # shellcheck disable=SC20863795 return $EXIT_CODE3796 fi37973798 if [ "${NVM_SILENT:-0}" -ne 1 ]; then
148 unmodified lines
39473948 nvm_ensure_version_installed "${provided_version}"3949 EXIT_CODE=$?3950 if [ "${EXIT_CODE}" != "0" ]; then3951 # shellcheck disable=SC20863952 return $EXIT_CODE3953 fi3954 local NVM_VERSION_DIR3955 NVM_VERSION_DIR="$(nvm_version_path "${VERSION}")"
428 unmodified lines