Fixes issue where if there are no files to sign detected the script just
hangs indefinitely. Instead if the files_to_sign array is empty then
exit 1 and inform user.
Change-Id: I82a5957faedfe739800305a8224fed67d2c74801
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
! -name "maven-metadata-local.xml" \
! -name "maven-metadata.xml"))
+ if [ "${#files_to_sign[@]}" -eq 0 ]; then
+ echo "ERROR: No files to sign. Quitting..."
+ exit 1
+ fi
+
if hash parallel 2>/dev/null; then
echo "Signing in parallel..."
parallel --jobs 200% --halt now,fail=1 "$GPG_BIN --batch -abq {}" ::: ${files_to_sign[*]}