Skip to content
Myr

Add `nvm_get_mirror`

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 9c65197 · Browse files · 2 files+28 added−1 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+28 added−1 removed

  • tests:+16 added−0 removed
  • other:+12 added−1 removed

2 files+28 added−1 removed

added:test/fast/Unit tests/nvm_get_mirror+16 added
1#!/bin/sh23set -ex45die () { echo $@ ; exit 1; }67. ../../../nvm.sh89! nvm_get_mirror || die 'unknown release type did not error'10! nvm_get_mirror node || die 'unknown release type did not error'11! nvm_get_mirror iojs || die 'unknown release type did not error'12! nvm_get_mirror node foo || die 'unknown release type did not error'13! nvm_get_mirror iojs foo || die 'unknown release type did not error'1415[ "$(nvm_get_mirror node std)" = "${NVM_NODEJS_ORG_MIRROR}" ] || die 'node std did not yield NVM_NODEJS_ORG_MIRROR'16[ "$(nvm_get_mirror iojs std)" = "${NVM_IOJS_ORG_MIRROR}" ] || die 'node std did not yield NVM_NODEJS_ORG_MIRROR'
modified:nvm.sh+12 added-1 removed
1363 unmodified lines
1364nvm_is_merged_node_version() {1365 nvm_version_greater_than_or_equal_to "$1" v4.0.01366}13671368nvm_get_mirror() {1369 case "${1}-${2}" in1370 node-std) nvm_echo "${NVM_NODEJS_ORG_MIRROR}" ;;1371 iojs-std) nvm_echo "${NVM_IOJS_ORG_MIRROR}" ;;1372 *)1373 nvm_err 'unknown type of node.js or io.js release'1374 return 11375 ;;1376 esac1377}13781379nvm_install_merged_node_binary() {1380 local NVM_NODE_TYPE1381 NVM_NODE_TYPE="${1}"1382 local MIRROR
1502 unmodified lines
2885 nvm_is_iojs_version nvm_is_alias \2886 nvm_ls_remote nvm_ls_remote_iojs nvm_ls_remote_index_tab \2887 nvm_ls nvm_remote_version nvm_remote_versions \2888 nvm_install_iojs_binary nvm_install_node_binary \2878 nvm_install_merged_node_binary \2889 nvm_install_merged_node_binary nvm_get_mirror \2890 nvm_install_node_source nvm_check_file_permissions \2891 nvm_get_checksum_alg \2892 nvm_version nvm_rc_version nvm_match_version \2893 nvm_ensure_default_set nvm_get_arch nvm_get_os \
82 unmodified lines