Skip to content

Commit 90f49cc

Browse files
committed
Improve build script error handling
1 parent 5dd56af commit 90f49cc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

latest-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ _xpath_url() {
4949
}
5050

5151
echo + "curl -sSL $(quote "$DOWNLOADS_WEBPAGE_URL")" >&2
52-
DOWNLOADS_WEBPAGE="$(_curl "$DOWNLOADS_WEBPAGE_URL" | sed -e '1,/^$/d')"
52+
DOWNLOADS_WEBPAGE="$(_curl "$DOWNLOADS_WEBPAGE_URL" | sed -e '1,/^$/d' ||:)"
5353
[ -n "$DOWNLOADS_WEBPAGE" ] || { echo "Failed to request LimeSurvey downloads webpage: $DOWNLOADS_WEBPAGE_URL" >&2; exit 1; }
5454

55-
ARCHIVE_URL="$(_xpath_url "$(sed -e 's#/[^/]*%s.*$#/#' <<< "$ARCHIVE_URL_TEMPLATE")" <<< "$DOWNLOADS_WEBPAGE")"
55+
ARCHIVE_URL="$(_xpath_url "$(sed -e 's#/[^/]*%s.*$#/#' <<< "$ARCHIVE_URL_TEMPLATE")" <<< "$DOWNLOADS_WEBPAGE" ||:)"
5656
[ -n "$ARCHIVE_URL" ] || { echo "Malformed LimeSurvey downloads webpage: $DOWNLOADS_WEBPAGE_URL" >&2; exit 1; }
5757

5858
ARCHIVE_URL_REGEX="$(printf "$(sed -e 's/[]\/$*.^[]/\\&/g' <<< "$ARCHIVE_URL_TEMPLATE")" "$VERSION_REGEX")"

0 commit comments

Comments
 (0)