Skip to content
This repository was archived by the owner on Nov 6, 2018. It is now read-only.

Commit 8380b4a

Browse files
committed
Update __get_remote_file logic
1 parent dd44712 commit 8380b4a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

build.sh

+5-6
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,16 @@ __get_remote_file() {
9999
return 0
100100
fi
101101

102-
failed=false
102+
local succeeded=false
103103
if __machine_has wget; then
104-
wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true
104+
wget --tries 10 --quiet -O "$local_path" "$remote_path" && succeeded=true
105105
fi
106106

107-
if [ "$failed" = true ] && __machine_has curl; then
108-
failed=false
109-
curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true
107+
if [ "$succeeded" = false ] && __machine_has curl; then
108+
curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" && succeeded=true
110109
fi
111110

112-
if [ "$failed" = true ]; then
111+
if [ "$succeeded" = false ]; then
113112
__error "Download failed: $remote_path" 1>&2
114113
return 1
115114
fi

0 commit comments

Comments
 (0)