[Refactor] `nvm_install_binary`: remove unused `nvm_get_mirror` call

Jordan Harband 2016-09-15 21:40:44 -07:00
parent 63fe22d635
commit dca0220275
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 5 additions and 8 deletions

13
nvm.sh
View File

@ -1487,7 +1487,7 @@ nvm_get_mirror() {
esac esac
} }
# args: flavor, kind, version, reinstall # args: flavor, type, version, reinstall
nvm_install_binary() { nvm_install_binary() {
local FLAVOR local FLAVOR
case "${1-}" in case "${1-}" in
@ -1498,11 +1498,8 @@ nvm_install_binary() {
;; ;;
esac esac
local MIRROR local TYPE
MIRROR="$(nvm_get_mirror node "${2-}")" TYPE="${2-}"
if [ -z "${MIRROR}" ]; then
return 3
fi
local PREFIXED_VERSION local PREFIXED_VERSION
PREFIXED_VERSION="${3-}" PREFIXED_VERSION="${3-}"
@ -1525,7 +1522,7 @@ nvm_install_binary() {
local TMPDIR local TMPDIR
local VERSION_PATH local VERSION_PATH
TARBALL="$(nvm_download_artifact "${FLAVOR}" binary std "${VERSION}" | command tail -1)" TARBALL="$(nvm_download_artifact "${FLAVOR}" binary "${TYPE-}" "${VERSION}" | command tail -1)"
if [ -f "${TARBALL}" ]; then if [ -f "${TARBALL}" ]; then
TMPDIR="$(dirname "${TARBALL}")/files" TMPDIR="$(dirname "${TARBALL}")/files"
fi fi
@ -1569,7 +1566,7 @@ nvm_get_download_slug() {
esac esac
local VERSION local VERSION
VERSION="${3}" VERSION="${3-}"
local NVM_OS local NVM_OS
NVM_OS="$(nvm_get_os)" NVM_OS="$(nvm_get_os)"