string replacement turns out not POSIX compliant

master
Koen Punt 2014-07-18 16:18:17 +02:00
parent 423629c38b
commit d67f2b110d
2 changed files with 12 additions and 14 deletions

View File

@ -16,13 +16,12 @@ nvm_download() {
curl $* curl $*
elif nvm_has "wget"; then elif nvm_has "wget"; then
# Emulate curl with wget # Emulate curl with wget
ARGS="$*" ARGS=$(echo "$*" | sed -e 's/--progress-bar /--progress=bar /' \
ARGS=${ARGS/--progress-bar /--progress=bar } -e 's/-L //' \
ARGS=${ARGS/-L /} -e 's/-I //' \
ARGS=${ARGS/-I /} -e 's/-s /-q /' \
ARGS=${ARGS/-s /-q } -e 's/-o /-O /' \
ARGS=${ARGS/-o /-O } -e 's/-C - /-c /')
ARGS=${ARGS/-C - /-c }
wget $ARGS wget $ARGS
fi fi
} }

13
nvm.sh
View File

@ -17,13 +17,12 @@ nvm_download() {
curl $* curl $*
elif nvm_has "wget"; then elif nvm_has "wget"; then
# Emulate curl with wget # Emulate curl with wget
ARGS="$*" ARGS=$(echo "$*" | sed -e 's/--progress-bar /--progress=bar /' \
ARGS=${ARGS/--progress-bar /--progress=bar } -e 's/-L //' \
ARGS=${ARGS/-L /} -e 's/-I //' \
ARGS=${ARGS/-I /} -e 's/-s /-q /' \
ARGS=${ARGS/-s /-q } -e 's/-o /-O /' \
ARGS=${ARGS/-o /-O } -e 's/-C - /-c /')
ARGS=${ARGS/-C - /-c }
wget $ARGS wget $ARGS
fi fi
} }