Update __get_remote_file logic
This commit is contained in:
parent
51eed9332b
commit
a7490d7e39
11
build.sh
11
build.sh
|
|
@ -99,17 +99,16 @@ __get_remote_file() {
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
failed=false
|
local succeeded=false
|
||||||
if __machine_has wget; then
|
if __machine_has wget; then
|
||||||
wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true
|
wget --tries 10 --quiet -O "$local_path" "$remote_path" && succeeded=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$failed" = true ] && __machine_has curl; then
|
if [ "$succeeded" = false ] && __machine_has curl; then
|
||||||
failed=false
|
curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" && succeeded=true
|
||||||
curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$failed" = true ]; then
|
if [ "$succeeded" = false ]; then
|
||||||
__error "Download failed: $remote_path" 1>&2
|
__error "Download failed: $remote_path" 1>&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue