add option to use wget
This commit is contained in:
parent
f9e8866a52
commit
b738cc9d75
1 changed files with 14 additions and 14 deletions
28
docs/static/setup.sh
vendored
28
docs/static/setup.sh
vendored
|
@ -39,21 +39,21 @@ if [ ! -w `pwd` ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Parse all commandline options
|
||||||
|
while [[ "$#" -gt 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
-w|--wget) force_wget="true"; break;;
|
||||||
|
*) echo "Unknown parameter: $1"; exit 1;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
if [[ $curl_exists == "true" && $wget_exists == "true" ]]; then
|
if [[ $curl_exists == "true" && $wget_exists == "true" ]]; then
|
||||||
prompt="Detected both curl and wget, which one would you like to use? [default is curl]"
|
if [[ $force_wget == "true" ]]; then
|
||||||
options=("curl" "wget")
|
download_command="wget "
|
||||||
PS3="$prompt "
|
else
|
||||||
select opt in "${options[@]}" "Quit"; do
|
download_command="curl -O "
|
||||||
case "$REPLY" in
|
fi
|
||||||
|
|
||||||
1 ) download_command="curl -O "; break;;
|
|
||||||
2 ) download_command="wget "; break;;
|
|
||||||
|
|
||||||
$(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;;
|
|
||||||
*) download_command="curl -O "; break;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
elif [[ $curl_exists == "true" ]]; then
|
elif [[ $curl_exists == "true" ]]; then
|
||||||
download_command="curl -O "
|
download_command="curl -O "
|
||||||
elif [[ $wget_exists == "true" ]]; then
|
elif [[ $wget_exists == "true" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue