From 9c2127ce3347240c39c30c79d5c234ff294555a1 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Fri, 18 Jul 2014 16:18:17 +0200 Subject: [PATCH] string replacement turns out not POSIX compliant --- install.sh | 13 ++++++------- nvm.sh | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index eb45d73..d87137f 100755 --- a/install.sh +++ b/install.sh @@ -16,13 +16,12 @@ nvm_download() { curl $* elif nvm_has "wget"; then # Emulate curl with wget - ARGS="$*" - ARGS=${ARGS/--progress-bar /--progress=bar } - ARGS=${ARGS/-L /} - ARGS=${ARGS/-I /} - ARGS=${ARGS/-s /-q } - ARGS=${ARGS/-o /-O } - ARGS=${ARGS/-C - /-c } + ARGS=$(echo "$*" | sed -e 's/--progress-bar /--progress=bar /' \ + -e 's/-L //' \ + -e 's/-I //' \ + -e 's/-s /-q /' \ + -e 's/-o /-O /' \ + -e 's/-C - /-c /') wget $ARGS fi } diff --git a/nvm.sh b/nvm.sh index 6952224..1197059 100644 --- a/nvm.sh +++ b/nvm.sh @@ -17,13 +17,12 @@ nvm_download() { curl $* elif nvm_has "wget"; then # Emulate curl with wget - ARGS="$*" - ARGS=${ARGS/--progress-bar /--progress=bar } - ARGS=${ARGS/-L /} - ARGS=${ARGS/-I /} - ARGS=${ARGS/-s /-q } - ARGS=${ARGS/-o /-O } - ARGS=${ARGS/-C - /-c } + ARGS=$(echo "$*" | sed -e 's/--progress-bar /--progress=bar /' \ + -e 's/-L //' \ + -e 's/-I //' \ + -e 's/-s /-q /' \ + -e 's/-o /-O /' \ + -e 's/-C - /-c /') wget $ARGS fi }