Skip to content

Commit

Permalink
Fix(curl): make curl fail when a 404 is encountered
Browse files Browse the repository at this point in the history
Related: peimanja#7
  • Loading branch information
till committed Apr 14, 2024
1 parent 741be6f commit 0a88561
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ function installPromtool {
fi
fi


url="https://github.com/prometheus/prometheus/releases/download/v${promtoolVersion}/prometheus-${promtoolVersion}.linux-amd64.tar.gz"

echo "Downloading Promtool v${promtoolVersion}"
curl -s -S -L -o /tmp/promtool_${promtoolVersion} ${url}
curl --fail -s -S -L -o /tmp/promtool_${promtoolVersion} ${url}
if [ "${?}" -ne 0 ]; then
echo "Failed to download Promtool v${promtoolVersion}"
exit 1
Expand Down

0 comments on commit 0a88561

Please sign in to comment.