From: Thanh Ha Date: Tue, 29 Aug 2017 20:21:36 +0000 (-0400) Subject: Exit script with error if artifacts fail download X-Git-Tag: v0.9.0~1 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F6226%2F2;p=releng%2Flftools.git 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 --- 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" \