Skip to content

Commit 8d41b0b

Browse files
committed
Better error handling; fail early
1 parent 1e82e71 commit 8d41b0b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pelican/build-cmark.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# Echo all of our steps if DEBUG_STEPS is set
1414
test -n "$DEBUG_STEPS" && set -x
1515

16+
set -e # early exit if any step fails
17+
1618
#VERSION=0.28.3.gfm.20 ### not yet
1719
VERSION=0.28.3.gfm.12
1820
if [ "$1" != "" ]; then VERSION="$1"; fi
@@ -29,10 +31,10 @@ EXTRACTED_AS="cmark-gfm-$VERSION"
2931

3032
# Follow redirects, and place the result into known name $LOCAL
3133
if [ -f "$LOCAL" ]; then
32-
echo "Using cached tarball: ${LOCAL}"
34+
echo "Using cached tarball: ${LOCAL}" >&2
3335
else
34-
echo "Fetching from cmark archives"
35-
curl -sSL -o "$LOCAL" "$ARCHIVES/$VERSION.tar.gz" || exit 1
36+
echo "Fetching $VERSION from cmark archives" >&2
37+
curl -sSL --fail -o "$LOCAL" "$ARCHIVES/$VERSION.tar.gz"
3638
fi
3739

3840
# Clean anything old, then extract and build.

0 commit comments

Comments
 (0)