Browse Source

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

master
Jordan Harband 10 years ago
parent
commit
a4f89c6223
  1. 2
      install.sh
  2. 4
      nvm.sh
  3. 8
      test/slow/nvm_get_latest/nvm_get_latest

2
install.sh

@ -42,7 +42,7 @@ nvm_source() { @@ -42,7 +42,7 @@ nvm_source() {
nvm_download() {
if nvm_has "curl"; then
curl $*
curl -q $*
elif nvm_has "wget"; then
# Emulate curl with wget
ARGS=$(echo "$*" | command sed -e 's/--progress-bar /--progress=bar /' \

4
nvm.sh

@ -20,7 +20,7 @@ nvm_is_alias() { @@ -20,7 +20,7 @@ nvm_is_alias() {
nvm_get_latest() {
local NVM_LATEST_URL
if nvm_has "curl"; then
NVM_LATEST_URL="$(curl -w "%{url_effective}\n" -L -s -S http://latest.nvm.sh -o /dev/null)"
NVM_LATEST_URL="$(curl -q -w "%{url_effective}\n" -L -s -S http://latest.nvm.sh -o /dev/null)"
elif nvm_has "wget"; then
NVM_LATEST_URL="$(wget http://latest.nvm.sh --server-response -O /dev/null 2>&1 | awk '/^ Location: /{DEST=$2} END{ print DEST }')"
else
@ -37,7 +37,7 @@ nvm_get_latest() { @@ -37,7 +37,7 @@ nvm_get_latest() {
nvm_download() {
if nvm_has "curl"; then
curl $*
curl -q $*
elif nvm_has "wget"; then
# Emulate curl with wget
ARGS=$(echo "$*" | command sed -e 's/--progress-bar /--progress=bar /' \

8
test/slow/nvm_get_latest/nvm_get_latest

@ -10,12 +10,12 @@ cleanup() { @@ -10,12 +10,12 @@ cleanup() {
EXPECTED_VERSION="v12.3.456"
URL="https://github.com/creationix/nvm/releases/tag/$EXPECTED_VERSION"
EXPECTED_CURL_ARGS="-w %{url_effective}\n -L -s -S http://latest.nvm.sh -o /dev/null"
EXPECTED_CURL_ARGS="-q -w %{url_effective}\n -L -s -S http://latest.nvm.sh -o /dev/null"
EXPECTED_WGET_ARGS="http://latest.nvm.sh --server-response -O /dev/null"
curl() {
if [ "_$*" != "_$EXPECTED_CURL_ARGS" ]; then
echo 2>& "expected args ($EXPECTED_CURL_ARGS), got ($*)"
echo >&2 "expected args ($EXPECTED_CURL_ARGS), got ($*)"
return 1
else
echo $URL
@ -23,7 +23,7 @@ curl() { @@ -23,7 +23,7 @@ curl() {
}
wget() {
if [ "_$*" != "_$EXPECTED_WGET_ARGS" ]; then
echo 2>& "expected args ($EXPECTED_WGET_ARGS), got ($*)"
echo >&2 "expected args ($EXPECTED_WGET_ARGS), got ($*)"
return 1
else
local WGET_CONTENTS
@ -100,7 +100,7 @@ Saving to: ‘/dev/null’ @@ -100,7 +100,7 @@ Saving to: ‘/dev/null’
"
"$WGET_CONTENTS" | while read line
do
2>& echo "$line"
>&2 echo "$line"
done
fi
}

Loading…
Cancel
Save