From 6f51ac4e61cce3bb07e2c82bc72e03cc92b92968 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Tue, 29 Aug 2017 16:21:36 -0400 Subject: [PATCH] Exit script with error if artifacts fail download Improve error checking to handle a potential error case. Change-Id: I8ac39a0c5c84f6b23ea60a5c8e6601be76bf6afc Signed-off-by: Thanh Ha --- shell/sign | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/shell/sign b/shell/sign index ed5c81e5..5b2bcbc3 100755 --- a/shell/sign +++ b/shell/sign @@ -134,9 +134,12 @@ sign_nexus() { cd "$sign_dir" || exit 1 echo "Fetching artifacts from $nexus_repo_url to $sign_dir..." - wget --recursive --execute robots=off --no-parent --quiet \ - --no-host-directories --cut-dirs=3 \ - "$nexus_repo_url" + if ! wget -nv --recursive --execute robots=off --no-parent \ + --no-host-directories --cut-dirs=3 \ + "$nexus_repo_url"; then + echo "ERROR: Failed to download artifacts." + exit 1 + fi echo "Removing files that do not need to be cloned..." remove_files=($(find . -type f -name "index.html" \ -- 2.16.6