Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retries #27

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ for tool in "${selected[@]}"; do
cli)
description="CLI tools"
rel="https://api.github.com/repos/lf-lang/lingua-franca/releases/$suffix"
if ! kvp=$(curl -L -s -f -H "Accept: application/vnd.github+json" $rel 2>&1 | grep download_url | grep $os-$arch.tar.gz); then
if ! kvp=$(curl --retry 5 --retry-delay 2 --retry-max-time 30 -L -s -f -H "Accept: application/vnd.github+json" $rel 2>&1 | grep download_url | grep $os-$arch.tar.gz); then
echo "Error: Failed to fetch data from $rel" >&2
exit 1
fi
Expand All @@ -200,7 +200,7 @@ for tool in "${selected[@]}"; do
os_abbr="mac"
fi
rel="https://api.github.com/repos/lf-lang/epoch/releases/$suffix"
if ! kvp=$(curl -L -H "Accept: application/vnd.github+json" $rel 2>&1 | grep "download_url" | grep "$arch" | grep "$os_abbr"); then
if ! kvp=$(curl --retry 5 --retry-delay 2 --retry-max-time 30 -L -H "Accept: application/vnd.github+json" $rel 2>&1 | grep "download_url" | grep "$arch" | grep "$os_abbr"); then
echo "Error: Failed to fetch data from $rel" >&2
exit 1
fi
Expand All @@ -219,7 +219,6 @@ for tool in "${selected[@]}"; do
esac

echo "> Installing the ${kind:-$version} release for $os-$arch of $description..."
echo ""

# Download
cleanup $tool
Expand All @@ -231,8 +230,6 @@ for tool in "${selected[@]}"; do
install $tool
echo " * Removing temporary files"
cleanup $tool

echo ""
done

echo "> Done. Please ensure that $bin is on your PATH."
Expand Down