File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
2- set -e
2+ set -euo pipefail
33
44# Determine OS type and architecture
55OS=$( uname -s | tr ' [:upper:]' ' [:lower:]' )
5656echo " Downloading docs-builder for $OS /$ARCH ..."
5757
5858# Download the appropriate binary
59- curl -LO " https://github.com/elastic/docs-builder/releases/latest/download/$BINARY "
59+ if ! curl -LO " https://github.com/elastic/docs-builder/releases/latest/download/$BINARY " ; then
60+ echo " Error: Failed to download $BINARY . Please check your internet connection."
61+ exit 1
62+ fi
63+
64+ # Validate the downloaded file
65+ if [ ! -s " $BINARY " ]; then
66+ echo " Error: Downloaded file $BINARY is missing or empty."
67+ exit 1
68+ fi
6069
6170# Extract only the docs-builder file to /tmp directory
62- # Use -o flag to always overwrite files without prompting
63- unzip -j -o " $BINARY " docs-builder -d /tmp
71+ if ! unzip -j -o " $BINARY " docs-builder -d /tmp; then
72+ echo " Error: Failed to extract docs-builder from $BINARY ."
73+ exit 1
74+ fi
6475
6576# Ensure the binary is executable
6677chmod +x /tmp/docs-builder
You can’t perform that action at this time.
0 commit comments