Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nvm-sh/nvm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 881a01d285a5dbc1c11b78c8a324c24716c8e873
Choose a base ref
..
head repository: nvm-sh/nvm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 82afe22f957abd7521b424a64b0d315730f2cde4
Choose a head ref
Showing with 5 additions and 9 deletions.
  1. +5 −9 nvm.sh
14 changes: 5 additions & 9 deletions nvm.sh
Original file line number Diff line number Diff line change
@@ -86,12 +86,8 @@ nvm_has_colors() {
[ "${NVM_NUM_COLORS:--1}" -ge 8 ]
}

nvm_curl() {
command curl -q "$@"
}

nvm_curl_libz_support() {
nvm_curl -V 2>/dev/null | nvm_grep "^Features:" | nvm_grep -q "libz"
command curl -V 2>/dev/null | nvm_grep "^Features:" | nvm_grep -q "libz"
}

nvm_curl_use_compression() {
@@ -105,7 +101,7 @@ nvm_get_latest() {
if nvm_curl_use_compression; then
CURL_COMPRESSED_FLAG="--compressed"
fi
NVM_LATEST_URL="$(nvm_curl ${CURL_COMPRESSED_FLAG:-} -q -w "%{url_effective}\\n" -L -s -S https://latest.nvm.sh -o /dev/null)"
NVM_LATEST_URL="$(command curl ${CURL_COMPRESSED_FLAG:-} -q -w "%{url_effective}\\n" -L -s -S https://latest.nvm.sh -o /dev/null)"
elif nvm_has "wget"; then
NVM_LATEST_URL="$(wget -q https://latest.nvm.sh --server-response -O /dev/null 2>&1 | command awk '/^ Location: /{DEST=$2} END{ print DEST }')"
else
@@ -125,7 +121,7 @@ nvm_download() {
if nvm_curl_use_compression; then
CURL_COMPRESSED_FLAG="--compressed"
fi
nvm_curl --fail ${CURL_COMPRESSED_FLAG:-} -q "$@"
command curl --fail ${CURL_COMPRESSED_FLAG:-} -q "$@"
elif nvm_has "wget"; then
# Emulate curl with wget
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
@@ -469,7 +465,7 @@ nvm_clang_version() {
}

nvm_curl_version() {
nvm_curl -V | command awk '{ if ($1 == "curl") print $2 }' | command sed 's/-.*$//g'
command curl -V | command awk '{ if ($1 == "curl") print $2 }' | command sed 's/-.*$//g'
}

nvm_version_greater() {
@@ -3008,7 +3004,7 @@ nvm() {
nvm_err "awk: not found"
fi
if nvm_has "curl"; then
nvm_err "curl: $(nvm_command_info curl), $(nvm_curl -V | command head -n 1)"
nvm_err "curl: $(nvm_command_info curl), $(command curl -V | command head -n 1)"
else
nvm_err "curl: not found"
fi