Exit script with error if artifacts fail download 26/6226/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 29 Aug 2017 20:21:36 +0000 (16:21 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 30 Aug 2017 01:49:59 +0000 (21:49 -0400)
Improve error checking to handle a potential error case.

Change-Id: I8ac39a0c5c84f6b23ea60a5c8e6601be76bf6afc
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
shell/sign

index ed5c81e..5b2bcbc 100755 (executable)
@@ -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" \