Attempt again to capture error code

This commit is contained in:
Antoine Martin 2024-10-22 19:32:33 -04:00
parent bf51bb5980
commit 4242e8dd24
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -33,8 +33,9 @@ jobs:
count=1 count=1
while read pkgs; do while read pkgs; do
echo "[ $count / $total ] Sending $pkgs" echo "[ $count / $total ] Sending $pkgs"
# if fails continues to next result=$(wget -q $upstream/x86_64/$pkgs.apk || true)
if `wget -q $upstream/x86_64/$pkgs.apk`; then # if it doesn't exist, it is because it failed to download.
if [ -f $pkgs.apk ]; then
result=`curl -s --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file $pkgs.apk $downstream` result=`curl -s --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file $pkgs.apk $downstream`
if [ -n "$result" ]; then if [ -n "$result" ]; then
echo $result echo $result
@ -42,6 +43,7 @@ jobs:
rm -f $pkgs.apk rm -f $pkgs.apk
else else
echo "Error: Couldn't download $pkgs" echo "Error: Couldn't download $pkgs"
echo $result
fi fi
count=$(( count + 1 )) count=$(( count + 1 ))
done < missing done < missing