Try to not fail job on empty directories.

This commit is contained in:
Matthew Arnold 2021-01-18 14:22:38 -05:00 committed by GitHub
parent fd424f6985
commit 8112e93376
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,7 +29,7 @@ jobs:
for release in ${RELEASES} for release in ${RELEASES}
do do
release=${release%?} release=${release%?}
TARBALLS=$(curl --silent https://download.libguestfs.org/nbdkit/$release/ | xmllint --html --noblanks --xpath "/html/body/table/tr/td[contains(a/@href, '.tar.gz') and not(contains(a/@href, '.tar.gz.sig'))]/a/@href" -) TARBALLS=$(curl --silent https://download.libguestfs.org/nbdkit/$release/ | xmllint --html --noblanks --xpath "/html/body/table/tr/td[contains(a/@href, '.tar.gz') and not(contains(a/@href, '.tar.gz.sig'))]/a/@href" -) || true
for tarball in ${TARBALLS} for tarball in ${TARBALLS}
do do
IFS=\"$IFS read href tarball suffix <<< $tarball # Intentionally overwrite tarball IFS=\"$IFS read href tarball suffix <<< $tarball # Intentionally overwrite tarball
@ -40,6 +40,7 @@ jobs:
echo echo
continue continue
fi fi
latestrelease=$release
version=$major.$minor.$build version=$major.$minor.$build
tag=v$major.$minor.$build tag=v$major.$minor.$build
echo Branch: $release Tar: $tarball Tag: $tag echo Branch: $release Tar: $tarball Tag: $tag
@ -89,13 +90,13 @@ jobs:
done done
done done
latest=$(tail -n 1 <<< $release) latest=$(tail -n 1 <<< $latestrelease)
git checkout main git checkout main
if git rev-parse --verify $release if git rev-parse --verify $latestrelease
then then
echo Copy newest bindings from local $latest echo Copy newest bindings from local $latest
git checkout $latest ./ git checkout $latest ./
elif git rev-parse --verify origin/$release elif git rev-parse --verify origin/$latestrelease
then then
echo Copy newest bindings from remote $latest echo Copy newest bindings from remote $latest
git checkout origin/$latest ./ git checkout origin/$latest ./