Hopefully better error handling for download errors and missing game files.

This commit is contained in:
Storm Dragon 2023-06-24 18:36:38 -04:00
parent 0e8a15611a
commit d67b422a7d

View File

@ -286,7 +286,17 @@ download() {
# Skip if the item is in cache.
test -e "${cache}/${dest}" && continue
if ! curl -L4 -C - --retry 10 --output "${cache}/${dest}" "${i}" ; then
echo "Could not download \"$i\"..."
local exit_code="$?"
if [[ $exit_code -eq 22 ]]; then
echo "File not found: \"$i\" (HTTP 404)"
# Remove the empty file.
rm -f "${cache}/${dest}"
exit 1
fi
fi
if file -b "${cache}/${dest}" | grep -q "HTML document" ; then
echo "File not found: \"$i\" (HTML document probably 404)"
rm -f "${cache}/${dest}"
exit 1
fi
done
@ -1749,9 +1759,9 @@ download "https://erion.cf/files/ag_103.zip"
add_launcher "c:\Program Files\blind-drive\Blind Drive.exe"
;;
"Bloodshed")
download "http://www.samtupy.com/games/bloodshed.exe"
export winVer="win7"
install_wine_bottle speechsdk
download "http://www.samtupy.com/games/bloodshed.exe"
cp "${cache}/bloodshed.exe" "$WINEPREFIX/drive_c/Program Files/"
add_launcher "c:\Program Files\bloodshed.exe"
;;