Skip to content
Myr

Make sure to ignore `~/.curlrc` if it exists.

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 517817f · Browse files · 3 files+7 added−7 removed
This commit

State

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

Diff stats

3 files+7 added−7 removed

  • tests:+4 added−4 removed
  • other:+3 added−3 removed

3 files+7 added−7 removed

modified:test/slow/nvm_get_latest/nvm_get_latest+4 added-4 removed
8 unmodified lines
9. ../../../nvm.sh1011EXPECTED_VERSION="v12.3.456"12URL="https://github.com/creationix/nvm/releases/tag/$EXPECTED_VERSION"13EXPECTED_CURL_ARGS="-w %{url_effective}\n -L -s -S http://latest.nvm.sh -o /dev/null"13EXPECTED_CURL_ARGS="-q -w %{url_effective}\n -L -s -S http://latest.nvm.sh -o /dev/null"14EXPECTED_WGET_ARGS="http://latest.nvm.sh --server-response -O /dev/null"1516curl() {17 if [ "_$*" != "_$EXPECTED_CURL_ARGS" ]; then18 echo 2>& "expected args ($EXPECTED_CURL_ARGS), got ($*)"18 echo >&2 "expected args ($EXPECTED_CURL_ARGS), got ($*)"19 return 120 else21 echo $URL22 fi23}24wget() {25 if [ "_$*" != "_$EXPECTED_WGET_ARGS" ]; then26 echo 2>& "expected args ($EXPECTED_WGET_ARGS), got ($*)"26 echo >&2 "expected args ($EXPECTED_WGET_ARGS), got ($*)"27 return 128 else29 local WGET_CONTENTS30 WGET_CONTENTS="
68 unmodified lines
99100"101 "$WGET_CONTENTS" | while read line102 do103 2>& echo "$line"103 >&2 echo "$line"104 done105 fi106}107
10 unmodified lines
modified:install.sh+1 added-1 removed
40 unmodified lines
41}4243nvm_download() {44 if nvm_has "curl"; then45 curl $*45 curl -q $*46 elif nvm_has "wget"; then47 # Emulate curl with wget48 ARGS=$(echo "$*" | command sed -e 's/--progress-bar /--progress=bar /' \49 -e 's/-L //' \
194 unmodified lines
modified:nvm.sh+2 added-2 removed
18 unmodified lines
1920nvm_get_latest() {21 local NVM_LATEST_URL22 if nvm_has "curl"; then23 NVM_LATEST_URL="$(curl -w "%{url_effective}\n" -L -s -S http://latest.nvm.sh -o /dev/null)"23 NVM_LATEST_URL="$(curl -q -w "%{url_effective}\n" -L -s -S http://latest.nvm.sh -o /dev/null)"24 elif nvm_has "wget"; then25 NVM_LATEST_URL="$(wget http://latest.nvm.sh --server-response -O /dev/null 2>&1 | awk '/^ Location: /{DEST=$2} END{ print DEST }')"26 else27 >&2 echo 'nvm needs curl or wget to proceed.'
8 unmodified lines
36}3738nvm_download() {39 if nvm_has "curl"; then40 curl $*40 curl -q $*41 elif nvm_has "wget"; then42 # Emulate curl with wget43 ARGS=$(echo "$*" | command sed -e 's/--progress-bar /--progress=bar /' \44 -e 's/-L //' \
1740 unmodified lines