From 018e47bec0573fc9576e7a9d1e6fd59530a722af Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 7 Jul 2014 13:32:08 -0700 Subject: [PATCH] Make sure both wget and curl work. --- install.sh | 6 ++++-- nvm.sh | 12 +++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index e86cd4a..49a850b 100755 --- a/install.sh +++ b/install.sh @@ -17,12 +17,14 @@ nvm_curl() { elif nvm_has "wget"; then # Emulate curl with wget ARGS="$*" - ARGS=${ARGS/--progress-bar /} + echo "original: $ARGS" + ARGS=${ARGS/--progress-bar /--progress=bar } ARGS=${ARGS/-L /} ARGS=${ARGS/-I /} - ARGS=${ARGS/-s /-q } + ARGS=${ARGS/-s /-qO- } ARGS=${ARGS/-o /-O } ARGS=${ARGS/-C /-c } + ARGS=${ARGS/ - / } wget $ARGS fi } diff --git a/nvm.sh b/nvm.sh index e0a30aa..ee2c9d2 100644 --- a/nvm.sh +++ b/nvm.sh @@ -18,13 +18,15 @@ nvm_curl() { elif nvm_has "wget"; then # Emulate curl with wget ARGS="$*" - ARGS=${ARGS/--progress-bar /} + echo "original: $ARGS" + ARGS=${ARGS/--progress-bar /--progress=bar } ARGS=${ARGS/-L /} ARGS=${ARGS/-I /} - ARGS=${ARGS/-s /-q } + ARGS=${ARGS/-s /-qO- } ARGS=${ARGS/-o /-O } ARGS=${ARGS/-C /-c } - wget "$ARGS" + ARGS=${ARGS/ - / } + wget $ARGS fi } @@ -407,10 +409,10 @@ nvm() { tmpdir="$NVM_DIR/src" local tmptarball tmptarball="$tmpdir/node-$VERSION.tar.gz" - if [ "`nvm_curl -Is "$NVM_NODEJS_ORG_MIRROR/$VERSION/node-$VERSION.tar.gz" | \grep '200 OK'`" != '' ]; then + if [ "`nvm_curl -s -I "$NVM_NODEJS_ORG_MIRROR/$VERSION/node-$VERSION.tar.gz" | \grep '200 OK'`" != '' ]; then tarball="$NVM_NODEJS_ORG_MIRROR/$VERSION/node-$VERSION.tar.gz" sum=`nvm_curl -s $NVM_NODEJS_ORG_MIRROR/$VERSION/SHASUMS.txt | \grep node-$VERSION.tar.gz | awk '{print $1}'` - elif [ "`nvm_curl -Is "$NVM_NODEJS_ORG_MIRROR/node-$VERSION.tar.gz" | \grep '200 OK'`" != '' ]; then + elif [ "`nvm_curl -s -I "$NVM_NODEJS_ORG_MIRROR/node-$VERSION.tar.gz" | \grep '200 OK'`" != '' ]; then tarball="$NVM_NODEJS_ORG_MIRROR/node-$VERSION.tar.gz" fi if (