**Improve error handling:** (scripts/install-for-ci.sh: *Ln: 34-47* (#607)

* Improve error handling: ln: 34-47

* Fixed Spacing: Ln: 34

* Fixed Curl Exit Code: Ln: 45
This commit is contained in:
io.shift 2025-08-12 13:38:44 -05:00 committed by GitHub
parent feb5647990
commit e6ccbc4430
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,10 +33,16 @@ log () {
fetch () {
echo "Downloading $1..."
if curl --no-progress-bar --retry 10 -o $2 -L $1; then
return 0;
if curl --no-progress-bar --retry 10 --connect-timeout 30 \
--max-time 300 -o "$2" -L "$1" 2>&1; then
echo "✓ Successfully downloaded $1"
return 0
else
echo "Failed to download $1."
code=$? # capture curl's exit code immediately
echo "✗ Failed to download $1"
echo " URL: $1"
echo " Destination: $2"
echo " Curl exit code: $code"
exit 1
fi
}