[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 <iannucci@chromium.org>
Commit-Queue: Daniel Jacques <dnj@chromium.org>
changes/23/560723/2
Dan Jacques 8 years ago committed by Commit Bot
parent b1ad2f04c9
commit e82c0dec65

@ -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

Loading…
Cancel
Save