From e82c0dec6546d2c139b8271b802fac2af510dfd6 Mon Sep 17 00:00:00 2001 From: Dan Jacques Date: Wed, 5 Jul 2017 18:10:23 -0700 Subject: [PATCH] [cipd] Fail if setup has an error. Make Linux/Mac CIPD wrapper fail if any step returns an error. Include the "-f" curl flag, which will cause it to error on non-200 status. BUG=chromium:739195 TEST=local R=iannucci@chromium.org Change-Id: I3efea3f38c1ee322cb9d63f29819472564107ddc Reviewed-on: https://chromium-review.googlesource.com/560723 Reviewed-by: Robbie Iannucci Commit-Queue: Daniel Jacques --- cipd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cipd b/cipd index 5030437b7..b29915789 100755 --- a/cipd +++ b/cipd @@ -4,6 +4,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +set -e -o pipefail + MYPATH=$(dirname "${BASH_SOURCE[0]}") : ${CIPD_CLIENT_VER:=`cat $MYPATH/cipd_client_version`} @@ -50,7 +52,7 @@ if [ ! -e "$CLIENT" ]; then echo "Bootstrapping cipd client for ${PLAT}-${ARCH}..." echo "From $URL" if hash curl 2> /dev/null ; then - curl "$URL" -A "$USER_AGENT" -L -o "$CLIENT" + curl "$URL" -f -A "$USER_AGENT" -L -o "$CLIENT" chmod +x "$CLIENT" else echo Your platform is missing the \`curl\` command. Please use your package