Skip to content

Commit 2248089

Browse files
committed
Make script fail on any error
1 parent db18ed5 commit 2248089

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

update_cblite_c.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
set -e
4+
35
RED="\e[31m"
46
GREEN="\e[32m"
57
ENDCOLOR="\e[0m"
@@ -53,15 +55,6 @@ else
5355
echoGreen "All good, let's start with CBlite $version :-)"
5456
fi
5557

56-
declare -i errors=0
57-
function checkErrors() {
58-
if [ ${errors} -ne 0 ]
59-
then
60-
>&2 echoRed "Failed at the following step: $1"
61-
exit 1
62-
fi
63-
}
64-
6558
tmpFolder=$(mktemp -d)
6659
echo "Temporary directory ${tmpFolder}"
6760

@@ -89,11 +82,7 @@ function download() {
8982
local url="https://packages.couchbase.com/releases/couchbase-lite-c/${version}/couchbase-lite-c-enterprise-${version}-${suffix}"
9083
local file="${tmpDownloadFolder}/${suffix}"
9184

92-
if ! wget --quiet --show-progress --output-document "${file}" "${url}"
93-
then
94-
>&2 echo "Unable to download '${url}'."
95-
errors+=1
96-
fi
85+
wget --quiet --show-progress --output-document "${file}" "${url}"
9786
}
9887

9988
for platform in "${!platforms[@]}"
@@ -104,7 +93,6 @@ do
10493
download $fileName
10594
done
10695

107-
checkErrors "Download packages"
10896
echoGreen "Downloading successful"
10997

11098
# ############## #

0 commit comments

Comments
 (0)